var __defProp = Object.defineProperty;
var __typeError = (msg) => {
  throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateWrapper = (obj, member, setter, getter) => ({
  set _(value) {
    __privateSet(obj, member, value, setter);
  },
  get _() {
    return __privateGet(obj, member, getter);
  }
});
var _emittingCount;
import * as a$b from "cesium";
import * as turf from "@turf/turf";
const defaultToken = { "ion": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MjNjYmVlOC1kZDA0LTQ0OGUtYTVjZS1jNDFlNTYxZTdkMjkiLCJpZCI6MjAxOTQ4LCJpYXQiOjE3MTA0MjI1ODZ9.giSWCQOKlRs3mxr3X1Z1grwevurK1c89rNhLueeEvQo" };
const defaultViewRectangle = [41.728921, -26.042904, 174.271087, 86.861514];
const defaultViewCenter = [108, 34];
const pick = (obj, keys2) => {
  if (!obj)
    return {};
  return keys2.reduce((acc, key) => {
    if (Object.prototype.hasOwnProperty.call(obj, key))
      acc[key] = obj[key];
    return acc;
  }, {});
};
const get$2 = (value, path, defaultValue) => {
  const segments = path.split(/[\.\[\]]/g);
  let current = value;
  for (const key of segments) {
    if (current === null)
      return defaultValue;
    if (current === void 0)
      return defaultValue;
    const dequoted = key.replace(/['"]/g, "");
    if (dequoted.trim() === "")
      continue;
    current = current[dequoted];
  }
  if (current === void 0)
    return defaultValue;
  return current;
};
const toString$1 = Object["prototype"]["toString"];
function is(a2, b2) {
  return toString$1["call"](a2) === "[object " + b2 + "]";
}
function isDef(a2) {
  return typeof a2 !== "undefined";
}
function isUnDef(a2) {
  return !isDef(a2);
}
function isObject(a2) {
  return a2 !== null && is(a2, "Object");
}
function isEmpty(a2) {
  if (isArray(a2) || isString(a2)) return a2["length"] === 0;
  if (a2 instanceof Map || a2 instanceof Set) return a2["size"] === 0;
  if (isObject(a2)) return Object["keys"](a2)["length"] === 0;
  return ![];
}
function isDate(a2) {
  return is(a2, "Date");
}
function isNumber(a2) {
  return is(a2, "Number");
}
function isPromise(a2) {
  return is(a2, "Promise") && isObject(a2) && isFunction(a2["then"]) && isFunction(a2["catch"]);
}
function isString(a2) {
  return is(a2, "String");
}
function isFunction(a2) {
  return typeof a2 === "function";
}
function isBoolean(a2) {
  return is(a2, "Boolean");
}
function isRegExp(a2) {
  return is(a2, "RegExp");
}
function isArray(a2) {
  return a2 && Array["isArray"](a2);
}
function isWindow(a2) {
  return typeof window !== "undefined" && is(a2, "Window");
}
function isElement(a2) {
  return a2 !== null && typeof a2 === "object" && a2["nodeType"] === 1 && typeof a2["tagName"] === "string";
}
function isMap(a2) {
  return is(a2, "Map");
}
function isUrl(a2) {
  const b2 = /^(http|https):\/\//;
  return b2["test"](a2);
}
function isDark() {
  return window["matchMedia"]("(prefers-color-scheme: dark)")["matches"];
}
function isImgPath(a2) {
  return /(https?:\/\/|data:image\/).*?\.(png|jpg|jpeg|gif|svg|webp|ico)/i["test"](a2);
}
function isMergeableObject(a2) {
  const b2 = a2 && typeof a2 === "object";
  return b2 && Object["prototype"]["toString"]["call"](a2) !== "[object RegExp]" && Object["prototype"]["toString"]["call"](a2) !== "[object Date]";
}
function isSimpleType(a2) {
  if (a2 == null || a2 == void 0) return ![];
  return isString(a2) || isBoolean(a2) || isNumber(a2) || Array["isArray"](a2) ? !![] : ![];
}
function formatNum(b2, c2 = 0) {
  const d2 = 10 ** c2;
  return Math["round"](b2 * d2) / d2;
}
const templateReg = /\{\{\s*([\w\u4E00-\u9FA5]+)\s*\}\}/g;
function template(b2, c2, d2 = ![]) {
  if (b2 == null || !templateReg["test"](b2)) return b2;
  return b2["replace"](templateReg, (e2, f2, g2, h2) => {
    let i2 = get$2(c2, f2);
    if (!a$b["defined"](i2)) return d2 ? "" : e2;
    if (isFunction(i2)) {
      i2 = i2(c2);
      if (!a$b["defined"](i2)) return d2 ? "" : e2;
    } else {
      if (i2["getValue"] && isFunction(i2["getValue"])) {
        i2 = i2["getValue"](a$b["JulianDate"]["now"]());
        if (!a$b["defined"](i2)) return d2 ? "" : e2;
      }
    }
    return i2;
  });
}
const _LatLngPoint = class _LatLngPoint {
  constructor(b2, c2, d2) {
    __publicField(this, "_lng");
    __publicField(this, "_lat");
    __publicField(this, "_alt");
    this["_lng"] = b2 !== void 0 ? +b2 : 0, this["_lat"] = c2 !== void 0 ? +c2 : 0, this["_alt"] = d2 !== void 0 ? +d2 : 0;
  }
  static ["parse"](b2, c2) {
    if (!b2) return new _LatLngPoint();
    let d2;
    if (typeof b2 === "string") d2 = _LatLngPoint["fromString"](b2);
    else {
      if (Array["isArray"](b2)) d2 = _LatLngPoint["fromArray"](b2);
      else {
        if (b2 instanceof _LatLngPoint) d2 = b2["clone"]();
        else {
          if (a$b["defined"](b2["lat"]) && a$b["defined"](b2["lng"])) {
            d2 = new _LatLngPoint(b2["lng"], b2["lat"], b2["alt"]);
            for (const e2 in b2) {
              d2[e2] = b2[e2];
            }
          } else {
            if (b2 instanceof a$b["Cartesian3"] || b2["_value"] || typeof b2["getValue"] === "function") d2 = _LatLngPoint["fromCartesian"](b2, c2);
            else {
              if (b2 instanceof a$b["Cartographic"]) d2 = _LatLngPoint["fromCartographic"](b2);
              else {
                if (a$b["defined"](b2["x"]) && a$b["defined"](b2["y"])) {
                  const f2 = new a$b["Cartesian3"](b2["x"], b2["y"], b2["z"]);
                  d2 = _LatLngPoint["fromCartesian"](f2, c2);
                } else d2 = new _LatLngPoint(), handlerError("NOT_THROW", "parse: 坐标解析失败，请确认参数是否无误：" + b2);
              }
            }
          }
        }
      }
    }
    return d2;
  }
  static ["fromArray"](b2) {
    const c2 = new _LatLngPoint();
    return Array["isArray"](b2) && (c2["lng"] = b2[0] || 0, c2["lat"] = b2[1] || 0, c2["alt"] = b2[2] || 0), c2;
  }
  static ["fromString"](b2) {
    let c2 = new _LatLngPoint();
    if (b2 && typeof b2 === "string") {
      const d2 = b2["split"](",");
      c2 = _LatLngPoint["fromArray"](d2["map"](Number["parseFloat"]));
    }
    return c2;
  }
  static ["fromCartesian"](b2, c2) {
    const d2 = new _LatLngPoint();
    let e2;
    if (b2 instanceof a$b["Cartesian3"]) e2 = b2;
    else {
      if (b2["_value"] && b2["_value"] instanceof a$b["Cartesian3"]) e2 = b2["_value"];
      else typeof b2["getValue"] == "function" ? e2 = b2["getValue"](c2 || a$b["JulianDate"]["now"]()) : e2 = void 0;
    }
    if (e2) {
      const f2 = a$b["Cartographic"]["fromCartesian"](e2);
      f2 && (d2["lat"] = a$b["Math"]["toDegrees"](f2["latitude"]), d2["lng"] = a$b["Math"]["toDegrees"](f2["longitude"]), d2["alt"] = f2["height"], d2["format"]());
    }
    return d2;
  }
  static ["fromCartographic"](b2) {
    const c2 = new _LatLngPoint();
    return b2 && (c2["lat"] = a$b["Math"]["toDegrees"](b2["latitude"]), c2["lng"] = a$b["Math"]["toDegrees"](b2["longitude"]), c2["alt"] = b2["height"]), c2;
  }
  static ["toCartesian"](b2, c2) {
    return _LatLngPoint["parse"](b2, c2)["toCartesian"]();
  }
  static ["toCartographic"](b2, c2) {
    return _LatLngPoint["parse"](b2, c2)["toCartographic"]();
  }
  get ["lng"]() {
    return this["_lng"];
  }
  set ["lng"](b2) {
    this["setLng"](+b2);
  }
  ["setLng"](b2) {
    this["_lng"] = +b2;
  }
  get ["lat"]() {
    return this["_lat"];
  }
  set ["lat"](b2) {
    this["setLat"](+b2);
  }
  ["setLat"](b2) {
    this["_lat"] = +b2;
  }
  get ["alt"]() {
    return this["_alt"] || 0;
  }
  set ["alt"](b2) {
    this["setAlt"](+b2);
  }
  ["setAlt"](b2) {
    this["_alt"] = +b2;
  }
  ["clone"]() {
    const b2 = new _LatLngPoint();
    return b2["lng"] = this["lng"] || 0, b2["lat"] = this["lat"] || 0, b2["alt"] = this["alt"] || 0, b2;
  }
  ["format"]() {
    return this["lng"] = formatNum(this["lng"], _LatLngPoint["FormatLength"]), this["lat"] = formatNum(this["lat"], _LatLngPoint["FormatLength"]), this["alt"] = formatNum(this["alt"], _LatLngPoint["FormatAltLength"]), this;
  }
  ["toArray"](b2 = ![]) {
    return this["format"](), b2 ? [this["lng"], this["lat"], this["alt"]] : [this["lng"], this["lat"]];
  }
  ["toString"]() {
    return this["format"](), this["lng"] + "," + this["lat"] + "," + this["alt"];
  }
  ["toCartesian"]() {
    return a$b["Cartesian3"]["fromDegrees"](this["lng"], this["lat"], this["alt"]);
  }
  ["toCartographic"]() {
    return a$b["Cartographic"]["fromDegrees"](this["lng"], this["lat"], this["alt"]);
  }
  ["equals"](b2) {
    return this === b2 || b2 instanceof _LatLngPoint && this["_alt"] === b2["_alt"] && this["_lat"] === b2["_lat"] && this["_lng"] === b2["_lng"];
  }
  ["valid"]() {
    return this["_lat"] !== 0 && this["_lat"] >= -90 && this["_lat"] <= 90 && this["_lng"] !== 0 && this["_lng"] >= -180 && this["_lng"] <= 180;
  }
};
__publicField(_LatLngPoint, "FormatLength", 6);
__publicField(_LatLngPoint, "FormatAltLength", 2);
let LatLngPoint = _LatLngPoint;
const ChinaCRS = { "WGS84": "WGS84", "GCJ02": "GCJ02", "BD09": "BD09" };
const ClipType = { "Z": 1, "ZR": 2, "X": 3, "XR": 4, "Y": 5, "YR": 6 };
const CRS = { "EPSG3857": "EPSG:3857", "EPSG4326": "EPSG:4326", "EPSG4490": "EPSG:4490", "CGCS2000_GK_Zone_3": "CGCS2000_GK_Zone_3", "CGCS2000_GK_Zone_6": "CGCS2000_GK_Zone_6", "CGCS2000_GK_CM_3": "CGCS2000_GK_CM_3", "CGCS2000_GK_CM_6": "CGCS2000_GK_CM_6" };
const CustomShaderType = { "DistanceColorChange": "DistanceColorChange", "DynamicHalo": "DynamicHalo" };
const EventType = { "add": "add", "remove": "remove", "addGraphic": "addGraphic", "removeGraphic": "removeGraphic", "addLayer": "addLayer", "removeLayer": "removeLayer", "addControl": "addControl", "removeControl": "removeControl", "addEffect": "addEffect", "removeEffect": "removeEffect", "update": "update", "updateStyle": "updateStyle", "updateAttr": "updateAttr", "show": "show", "hide": "hide", "start": "start", "change": "change", "endOne": "endOne", "end": "end", "stop": "stop", "loadBeforeDeal": "loadBeforeDeal", "load": "load", "error": "error", "loadConfig": "loadConfig", "contextMenuOpen": "contextMenuOpen", "contextMenuClose": "contextMenuClose", "contextMenuClick": "contextMenuClick", "highlightOpen": "highlightOpen", "highlightClose": "highlightClose", "click": "click", "clickGraphic": "clickGraphic", "clickTileGraphic": "clickTileGraphic", "clickMap": "clickMap", "dblClick": "dblClick", "leftDown": "leftDown", "leftUp": "leftUp", "mouseMove": "mouseMove", "mouseMoveTarget": "mouseMoveTarget", "wheel": "wheel", "rightClick": "rightClick", "rightDown": "rightDown", "rightUp": "rightUp", "middleClick": "middleClick", "middleDown": "middleDown", "middleUp": "middleUp", "pinchStart": "pinchStart", "pinchEnd": "pinchEnd", "pinchMove": "pinchMove", "mouseDown": "mouseDown", "mouseUp": "mouseUp", "mouseOver": "mouseOver", "mouseOut": "mouseOut", "keydown": "keydown", "keyup": "keyup", "drawStart": "drawStart", "drawMouseMove": "drawMouseMove", "drawAddPoint": "drawAddPoint", "drawRemovePoint": "drawRemovePoint", "drawCreated": "drawCreated", "editStart": "editStart", "editMouseDown": "editMouseDown", "editMouseMove": "editMouseMove", "editMovePoint": "editMovePoint", "editAddPoint": "editAddPoint", "editRemovePoint": "editRemovePoint", "editStyle": "editStyle", "editStop": "editStop", "move": "move", "initialTilesLoaded": "initialTilesLoaded", "allTilesLoaded": "allTilesLoaded", "addTile": "addTile", "addTileSuccess": "addTileSuccess", "addTileError": "addTileError", "removeTile": "removeTile", "cameraMoveStart": "cameraMoveStart", "cameraMoveEnd": "cameraMoveEnd", "cameraChanged": "cameraChanged", "preUpdate": "preUpdate", "postUpdate": "postUpdate", "preRender": "preRender", "postRender": "postRender", "renderError": "renderError", "morphStart": "morphStart", "morphComplete": "morphComplete", "clockTick": "clockTick", "terrainChange": "terrainChange", "tileLoadProgress": "tileLoadProgress", "openPopup": "openPopup", "closePopup": "closePopup", "destroyPopup": "destroyPopup", "changePopupPosition": "changePopupPosition", "showPopupElement": "showPopupElement", "hidePopupElement": "hidePopupElement" };
const State = { "CREATED": "created", "INITED": "inited", "ADDED": "added", "REMOVED": "removed", "DESTROYED": "destroyed" };
class BaseClass {
  constructor(a2) {
    __publicField(this, "originOptions");
    __publicField(this, "uuid");
    __publicField(this, "_onEventHook");
    __publicField(this, "_events");
    __publicField(this, "_eventParents");
    __privateAdd(this, _emittingCount, 0);
    this["originOptions"] = { ...a2 }, this["uuid"] = guid();
  }
  ["_on"](a2, b2, c2) {
    this["_events"] = this["_events"] || {};
    let d2 = this["_events"][a2];
    !d2 && (d2 = [], this["_events"][a2] = d2);
    c2 == this && (c2 = void 0);
    const e2 = { "fn": b2, "ctx": c2 };
    for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
      if (d2[f2]["fn"] == b2 && d2[f2]["ctx"] == c2) return;
    }
    d2["push"](e2);
  }
  ["_off"](a2, b2, c2) {
    let d2, e2, f2;
    if (!this["_events"]) return;
    d2 = this["_events"][a2];
    if (!d2) return;
    if (!b2) {
      for (e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
        d2[e2]["fn"] = falseFn;
      }
      delete this["_events"][a2];
      return;
    }
    c2 == this && (c2 = void 0);
    if (d2) for (e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
      const g2 = d2[e2];
      if (g2["ctx"] != c2) continue;
      if (g2["fn"] == b2) {
        g2["fn"] = falseFn;
        __privateGet(this, _emittingCount) && (this["_events"][a2] = d2 = d2["slice"]());
        d2["splice"](e2, 1);
        return;
      }
    }
  }
  ["_propagateEvent"](a2) {
    for (const b2 in this["_eventParents"]) {
      this["_eventParents"][b2]["emit"](a2["type"], { "layer": a2["target"], "propagatedFrom": a2["target"], ...a2 }, !![]);
    }
  }
  ["destroy"](a2 = !![]) {
    if (a2) for (const b2 in this) {
      delete this[b2];
    }
  }
  ["on"](a2, b2, c2) {
    if (!a2) return handlerError("NOT_THROW", "on: 绑定事件时传入了空值"), this;
    if (Array["isArray"](a2)) for (let d2 = 0, e2 = a2["length"]; d2 < e2; d2++) {
      this["_on"](a2[d2], b2, c2);
    }
    else {
      if (isObject(a2)) for (const f2 in a2) {
        this["_on"](f2, a2[f2], c2);
      }
      else {
        a2 = a2["trim"]()["split"](/\s+/);
        for (let g2 = 0, h2 = a2["length"]; g2 < h2; g2++) {
          this["_on"](a2[g2], b2, c2);
        }
      }
    }
    return this["_onEventHook"] && this["_onEventHook"](a2), this;
  }
  ["off"](a2, b2, c2) {
    if (!a2) delete this["_events"];
    else {
      if (Array["isArray"](a2)) for (let d2 = 0, e2 = a2["length"]; d2 < e2; d2++) {
        this["_off"](a2[d2], b2, c2);
      }
      else {
        if (isObject(a2)) for (const f2 in a2) {
          this["_off"](f2, a2[f2], c2);
        }
        else {
          a2 = a2["trim"]()["split"](/\s+/);
          for (let g2 = 0, h2 = a2["length"]; g2 < h2; g2++) {
            this["_off"](a2[g2], b2, c2);
          }
        }
      }
    }
    return this;
  }
  ["emit"](a2, b2, c2) {
    if (!this["hasListener"](a2, c2)) return this;
    const d2 = { "type": a2, "target": this, "sourceTarget": (b2 == null ? void 0 : b2["sourceTarget"]) || this, "data": { ...b2 }, "_stopPropagation": ![], "stopPropagation"() {
      this["_stopPropagation"] = !![];
    } };
    if (this["_events"]) {
      const e2 = this["_events"][a2];
      if (e2) {
        __privateSet(this, _emittingCount, __privateGet(this, _emittingCount) + 1 || 1);
        for (let f2 = 0, g2 = e2["length"]; f2 < g2; f2++) {
          const h2 = e2[f2];
          h2["fn"]["call"](h2["ctx"] || this, d2);
        }
        __privateWrapper(this, _emittingCount)._--;
      }
    }
    return c2 && !d2["_stopPropagation"] && this["_propagateEvent"](d2), this;
  }
  ["once"](a2, b2, c2) {
    if (isObject(a2)) {
      for (const e2 in a2) {
        this["once"](e2, a2[e2], c2);
      }
      return this;
    }
    const d2 = bind(() => {
      this["off"](a2, b2, c2)["off"](a2, d2, c2);
    }, this);
    return this["on"](a2, b2, c2)["on"](a2, d2, c2);
  }
  ["hasListener"](a2, b2) {
    const c2 = this["_events"] && this["_events"][a2];
    if (c2 && c2["length"]) return !![];
    if (b2) for (const d2 in this["_eventParents"]) {
      if (this["_eventParents"][d2]["hasListener"](a2, b2)) return !![];
    }
    return ![];
  }
  ["addEventParent"](a2) {
    return this["_eventParents"] = this["_eventParents"] || {}, this["_eventParents"][a2["uuid"]] = a2, this;
  }
  ["removeEventParent"](a2) {
    return this["_eventParents"] && delete this["_eventParents"][a2["uuid"]], this;
  }
  ["hasEventParent"](a2) {
    return this["_eventParents"] && this["_eventParents"][a2["uuid"]] ? !![] : ![];
  }
}
_emittingCount = new WeakMap();
function falseFn() {
  return ![];
}
function bind(a2, b2, ...c2) {
  const d2 = Array["prototype"]["slice"];
  if (a2["bind"]) return a2["bind"]["apply"](a2, [b2]["concat"](d2["call"](c2)));
  return function(...e2) {
    return a2["apply"](b2, c2["length"] > 0 ? c2["concat"](e2) : e2);
  };
}
function deepClone(a2, b2 = [], c2 = 5) {
  if (a2 == null || typeof a2 !== "object") return a2;
  if (a2 instanceof Date) return new Date(a2["getTime"]());
  if (Array["isArray"](a2) && c2 >= 0) {
    const d2 = [];
    for (let e2 = 0, f2 = a2["length"]; e2 < f2; ++e2) {
      d2[e2] = deepClone(a2[e2], b2, c2 - 1);
    }
    return d2;
  }
  if (typeof a2 === "object" && c2 >= 0) {
    const g2 = {};
    for (const h2 in a2) {
      if (typeof a2[h2] === "function") continue;
      if (b2["includes"](h2)) continue;
      Reflect["has"](a2, h2) && (g2[h2] = deepClone(a2[h2], b2, c2 - 1));
    }
    return g2;
  }
  return a2;
}
const a$a = "";
function createDom(a2, b2 = "", c2 = null) {
  const d2 = document["createElement"](a2);
  return d2["className"] = b2, c2 && c2["appendChild"](d2), d2;
}
function createSvg(a2, b2, c2, d2 = null) {
  const e2 = document["createElementNS"]("http://www.w3.org/2000/svg", "svg");
  e2["setAttribute"]("class", "svg-path"), e2["setAttribute"]("width", "" + a2), e2["setAttribute"]("height", "" + b2), e2["setAttribute"]("viewBox", "0 0 " + a2 + " " + b2);
  const f2 = document["createElementNS"]("http://www.w3.org/2000/svg", "path");
  return f2["setAttribute"]("d", c2), e2["appendChild"](f2), d2 && d2["appendChild"](e2), e2;
}
function createVideo(a2, b2, c2, d2) {
  const e2 = createDom("video", c2, d2);
  e2["setAttribute"]("autoplay", "true"), e2["setAttribute"]("loop", "true"), e2["setAttribute"]("crossorigin", "anonymous");
  !b2 && (b2 = a2["substring"](a2["lastIndexOf"](".") + 1, a2["length"]));
  const f2 = createDom("source", "", e2);
  return f2["setAttribute"]("src", a2), f2["setAttribute"]("type", "video/" + b2), e2;
}
function get$1(a2) {
  return typeof a2 == "string" ? document["getElementById"](a2) : a2;
}
function parseDom(a2, b2 = ![], c2) {
  const d2 = document["createElement"]("div");
  return c2 && (d2["className"] = c2), d2["innerHTML"] = a2, b2 ? d2 : d2["childNodes"];
}
function remove(a2) {
  const b2 = typeof a2 === "string" ? document["getElementById"](a2) : a2;
  if (!b2) return;
  const c2 = b2["parentNode"];
  c2 && c2["removeChild"](b2);
}
function empty(a2) {
  while (a2["firstChild"]) {
    a2["removeChild"](a2["firstChild"]);
  }
}
function getStyle(a2, b2) {
  var _a, _b;
  let c2 = a2["style"][b2] || ((_a = window["getComputedStyle"](a2, null)) == null ? void 0 : _a["getPropertyValue"](b2)) || null;
  return (!c2 || c2 === "auto") && (c2 = ((_b = window["getComputedStyle"](a2, null)) == null ? void 0 : _b["getPropertyValue"](b2)) || null), c2 === "auto" ? null : c2;
}
function hasClass(a2, b2) {
  if (!a2) return ![];
  if (a2["classList"]) return a2["classList"]["contains"](b2);
  const c2 = a2["className"];
  return c2["length"] > 0 && new RegExp("(^|\\s)" + b2 + "(\\s|$)")["test"](c2);
}
function addClass(a2, b2) {
  if (!a2) return;
  if (a2["classList"]) {
    const c2 = b2["trim"]()["split"](/\s+/);
    for (let d2 = 0; d2 < c2["length"]; d2++) {
      a2["classList"]["add"](c2[d2]);
    }
  } else {
    const e2 = a2["className"]["trim"](), f2 = (e2 + " " + b2)["trim"]();
    f2 !== e2 && (a2["className"] = f2);
  }
}
function removeClass(a2, b2) {
  if (!a2) return;
  a2["classList"] ? a2["classList"]["remove"](b2) : hasClass(a2, b2) && (a2["className"] = (" " + a2["className"] + " ")["replace"](" " + b2 + " ", " ")["trim"]());
}
function setClass(a2, b2) {
  a2 instanceof SVGElement ? a2["className"]["baseVal"] = b2 : a2["className"] = b2;
}
function getClass(a2) {
  a2["correspondingElement"] && (a2 = a2["correspondingElement"]);
  if (a2 instanceof SVGElement) return a2["className"]["baseVal"];
  return a2["className"];
}
function enterFullscreen(a2) {
  if (!a2) return ![];
  const b2 = a2["requestFullscreen"] || a2["msRequestFullscreen"] || a2["mozRequestFullScreen"] || a2["webkitRequestFullscreen"];
  if (b2) return b2["call"](a2), !![];
  return ![];
}
function exitFullscreen() {
  const a2 = ["exitFullscreen", "msExitFullscreen", "mozCancelFullScreen", "webkitExitFullscreen"];
  for (const b2 of a2) {
    if (document[b2]) return document[b2](), !![];
  }
  return ![];
}
class Popup extends BaseClass {
  constructor(d2, e2) {
    super(e2);
    __publicField(this, "_viewer");
    __publicField(this, "_id");
    __publicField(this, "_container");
    __publicField(this, "_containerArrow");
    __publicField(this, "_containerContent");
    __publicField(this, "_containerCloseSvg");
    __publicField(this, "_currentWindowPosition");
    __publicField(this, "_currentCartesian");
    __publicField(this, "_htmlTemplate");
    __publicField(this, "_componentElement");
    __publicField(this, "_cameraCache");
    __publicField(this, "_direction");
    __publicField(this, "_contentType");
    __publicField(this, "_hasHide", ![]);
    __publicField(this, "emptyText", "暂无数据");
    __publicField(this, "_entity");
    __publicField(this, "options");
    this["options"] = e2, this["_viewer"] = d2, this["_id"] = a$b["defaultValue"](e2["id"], this["uuid"]), this["_direction"] = a$b["defaultValue"](e2["direction"], "top"), this["_contentType"] = a$b["defaultValue"](e2["contentType"], "html"), this["_htmlTemplate"] = e2["htmlTemplate"], this["_componentElement"] = e2["componentElement"], this["emptyText"] = a$b["defaultValue"](e2["emptyText"], "暂无数据"), this["setEntity"](this["options"]["entity"]), this["_initContainer"](), this["_bindPostRender"]();
  }
  get ["id"]() {
    return this["_id"];
  }
  get ["container"]() {
    return this["_container"];
  }
  get ["viewerContainer"]() {
    var _a;
    return (_a = this["_viewer"]) == null ? void 0 : _a["container"];
  }
  get ["direction"]() {
    return this["_direction"];
  }
  set ["direction"](d2) {
    this["_direction"] = d2, this["_setDivPosition"]();
  }
  get ["currentWindowPosition"]() {
    return this["_currentWindowPosition"];
  }
  set ["currentWindowPosition"](d2) {
    this["_currentWindowPosition"] = d2, this["_setDivPosition"]();
  }
  get ["currentCartesian"]() {
    return this["_currentCartesian"];
  }
  set ["currentCartesian"](d2) {
    this["_currentCartesian"] = d2, this["_setEntityPosition"]();
  }
  get ["entity"]() {
    return this["_entity"];
  }
  set ["entity"](d2) {
    this["setEntity"](d2);
  }
  ["_initContainer"]() {
    this["_contentType"] == "html" && (this["_container"] = createDom("div", "pie3d-popup"), this["_container"]["setAttribute"]("uuid", this["uuid"]), this["_container"]["setAttribute"]("id", "pie3d-popup-" + this["id"]), this["_container"]["style"]["display"] = "none", this["_containerArrow"] = createDom("div", "pie3d-popup-arrow pie3d-popup-rightArrow", this["_container"]), this["_containerContent"] = createDom("div", "pie3d-popup-inner", this["_container"]), this["_containerCloseSvg"] = parseDom('<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z"/></svg>')[0], this["_containerCloseSvg"]["classList"]["add"]("pie3d-popup-close"), this["_container"]["append"](this["_containerCloseSvg"]), this["_containerCloseSvg"]["addEventListener"]("click", (d2) => {
      this["close"]();
    }), this["viewerContainer"]["appendChild"](this["_container"]));
  }
  ["setEntity"](d2) {
    var _a, _b;
    const e2 = ((_a = this["_entity"]) == null ? void 0 : _a["show"]) ?? ![], f2 = ((_b = this["_entity"]) == null ? void 0 : _b["position"]) ?? a$b["Cartesian3"]["ZERO"];
    this["_entity"] && this["_viewer"]["entities"]["remove"](this["_entity"]), d2 && (this["_entity"] = d2 instanceof a$b["Entity"] ? d2 : isObject(d2) ? new a$b["Entity"](d2) : new a$b["Entity"]({ "id": "pie3d-popup-entity-" + this["id"], "position": a$b["Cartesian3"]["ZERO"], "billboard": { "image": a$a, "verticalOrigin": a$b["VerticalOrigin"]["TOP"] } }), this["_entity"]["show"] = e2, this["_entity"]["position"] = f2, this["_viewer"]["entities"]["add"](this["_entity"]));
  }
  ["_bindPostRender"]() {
    this["_viewer"]["scene"]["postRender"]["addEventListener"](this["_render"], this);
  }
  ["_unbindPostRender"]() {
    this["_viewer"]["scene"]["postRender"]["removeEventListener"](this["_render"], this);
  }
  ["_render"]() {
    var _a, _b, _c, _d;
    if (!this["currentCartesian"]) return;
    const d2 = this["currentCartesian"], e2 = this["_viewer"]["scene"], f2 = this["_contentType"] == "html" ? ((_a = this["_container"]) == null ? void 0 : _a["clientHeight"]) ?? 0 : this["_contentType"] == "component" ? ((_b = this["_componentElement"]) == null ? void 0 : _b["clientHeight"]) ?? 0 : 0, g2 = this["_contentType"] == "html" ? ((_c = this["_container"]) == null ? void 0 : _c["clientWidth"]) ?? 0 : this["_contentType"] == "component" ? ((_d = this["_componentElement"]) == null ? void 0 : _d["clientWidth"]) ?? 0 : 0;
    if (this["_isUnchange"](g2, f2)) return;
    if (e2["mode"] == a$b["SceneMode"]["SCENE3D"]) {
      const i2 = new a$b["EllipsoidalOccluder"](e2["globe"]["ellipsoid"], e2["camera"]["positionWC"]), j2 = i2["isPointVisible"](d2);
      if (!j2) {
        this["_container"] && (this["_container"]["style"]["display"] = "none");
        this["_componentElement"] && (this["_componentElement"]["style"]["display"] = "none");
        return;
      }
    }
    this["_container"] && (this["_container"]["style"]["display"] = this["_hasHide"] ? "none" : "block");
    this["_componentElement"] && (this["_componentElement"]["style"]["display"] = this["_hasHide"] ? "none" : "block");
    const h2 = a$b["SceneTransforms"]["worldToWindowCoordinates"](e2, d2) ?? this["_currentWindowPosition"];
    this["currentWindowPosition"] = h2;
  }
  ["_isUnchange"](d2, e2) {
    var _a, _b, _c;
    const f2 = this["_viewer"]["scene"]["camera"], g2 = { "x": (_a = this["_currentCartesian"]) == null ? void 0 : _a["x"], "y": (_b = this["_currentCartesian"]) == null ? void 0 : _b["y"], "z": (_c = this["_currentCartesian"]) == null ? void 0 : _c["z"], "p1": d2, "p2": e2, "p3": f2["positionWC"]["x"], "p4": f2["positionWC"]["y"], "p5": f2["positionWC"]["z"], "p6": f2["heading"], "p7": f2["pitch"], "p8": f2["roll"] };
    if (this["_cameraCache"] && g2["x"] == this["_cameraCache"]["x"] && g2["x"] == this["_cameraCache"]["x"] && g2["y"] == this["_cameraCache"]["y"] && g2["z"] == this["_cameraCache"]["z"] && g2["p1"] == this["_cameraCache"]["p1"] && g2["p2"] == this["_cameraCache"]["p2"] && g2["p3"] == this["_cameraCache"]["p3"] && g2["p4"] == this["_cameraCache"]["p4"] && g2["p5"] == this["_cameraCache"]["p5"] && g2["p6"] == this["_cameraCache"]["p6"] && g2["p7"] == this["_cameraCache"]["p7"] && g2["p8"] == this["_cameraCache"]["p8"]) return !![];
    return this["_cameraCache"] = g2, ![];
  }
  ["_setDivPosition"]() {
    var _a, _b, _c, _d;
    if (!this["_currentWindowPosition"]) return;
    const d2 = { "top": "unset", "left": "unset", "right": "unset", "bottom": "unset" }, e2 = this["_contentType"] == "html" ? ((_a = this["_container"]) == null ? void 0 : _a["clientHeight"]) ?? 0 : this["_contentType"] == "component" ? ((_b = this["_componentElement"]) == null ? void 0 : _b["clientHeight"]) ?? 0 : 0, f2 = this["_contentType"] == "html" ? ((_c = this["_container"]) == null ? void 0 : _c["clientWidth"]) ?? 0 : this["_contentType"] == "component" ? ((_d = this["_componentElement"]) == null ? void 0 : _d["clientWidth"]) ?? 0 : 0;
    if (this["direction"] == "right") d2["top"] = this["_currentWindowPosition"]["y"] - e2 / 2 + "px", d2["left"] = this["_currentWindowPosition"]["x"] + f2 + "px";
    else {
      if (this["direction"] == "left") d2["top"] = this["_currentWindowPosition"]["y"] - e2 / 2 + "px", d2["left"] = this["_currentWindowPosition"]["x"] - f2 + "px";
      else {
        if (this["direction"] == "top") d2["left"] = this["_currentWindowPosition"]["x"] - f2 / 2 + "px", d2["top"] = this["_currentWindowPosition"]["y"] - e2 + "px";
        else this["direction"] == "bottom" && (d2["left"] = this["_currentWindowPosition"]["x"] - f2 / 2 + "px", d2["top"] = this["_currentWindowPosition"]["y"] + e2 + "px");
      }
    }
    this["_contentType"] == "component" && this["_componentElement"] && (this["_componentElement"]["style"]["top"] = d2["top"], this["_componentElement"]["style"]["left"] = d2["left"]);
    if (this["_contentType"] == "html" && this["_container"]) {
      this["_container"]["style"]["top"] = d2["top"], this["_container"]["style"]["left"] = d2["left"];
      if (this["_containerArrow"]) {
        if (this["direction"] == "right") addClass(this["_containerArrow"], "pie3d-popup-rightArrow"), removeClass(this["_containerArrow"], "pie3d-popup-leftArrow"), removeClass(this["_containerArrow"], "pie3d-popup-topArrow"), removeClass(this["_containerArrow"], "pie3d-popup-bottomArrow");
        else {
          if (this["direction"] == "left") addClass(this["_containerArrow"], "pie3d-popup-leftArrow"), removeClass(this["_containerArrow"], "pie3d-popup-rightArrow"), removeClass(this["_containerArrow"], "pie3d-popup-topArrow"), removeClass(this["_containerArrow"], "pie3d-popup-bottomArrow");
          else {
            if (this["direction"] == "top") addClass(this["_containerArrow"], "pie3d-popup-topArrow"), removeClass(this["_containerArrow"], "pie3d-popup-rightArrow"), removeClass(this["_containerArrow"], "pie3d-popup-leftArrow"), removeClass(this["_containerArrow"], "pie3d-popup-bottomArrow");
            else this["direction"] == "bottom" && (addClass(this["_containerArrow"], "pie3d-popup-bottomArrow"), removeClass(this["_containerArrow"], "pie3d-popup-rightArrow"), removeClass(this["_containerArrow"], "pie3d-popup-leftArrow"), removeClass(this["_containerArrow"], "pie3d-popup-topArrow"));
          }
        }
      }
    }
    this["emit"]("changePopupPosition", { "id": this["id"], "popup": this, "pos": { "direction": this["direction"], ...d2 } });
  }
  ["_setEntityPosition"]() {
    this["_entity"] && this["_currentCartesian"] && (this["_entity"]["position"] = this["_currentCartesian"]);
  }
  ["hidePopupElement"]() {
    this["_cameraCache"] = void 0, this["_hasHide"] = !![], this["_container"] && (this["_container"]["style"]["display"] = "none"), this["_componentElement"] && (this["_componentElement"]["style"]["display"] = "none"), this["emit"]("hidePopupElement", { "id": this["id"], "popup": this });
  }
  ["showPopupElement"]() {
    this["_cameraCache"] = void 0, this["_hasHide"] = ![], this["_container"] && (this["_container"]["style"]["display"] = "block"), this["_componentElement"] && (this["_componentElement"]["style"]["display"] = "block"), this["emit"]("showPopupElement", { "id": this["id"], "popup": this });
  }
  async ["open"](d2, e2) {
    var _a, _b;
    this["_entity"] && (this["_entity"]["show"] = !![]);
    if (d2 instanceof a$b["Cartesian3"]) this["currentCartesian"] = d2;
    else d2 instanceof a$b["Cartesian2"] ? this["currentCartesian"] = new a$b["Cartesian3"](d2["x"], d2["y"], 0) : this["currentCartesian"] = this["currentCartesian"] ?? a$b["Cartesian3"]["ZERO"];
    const f2 = e2 ?? await ((_b = (_a = this["options"])["getData"]) == null ? void 0 : _b.call(_a, this["currentCartesian"])) ?? this["emptyText"];
    if (this["_containerContent"]) {
      this["_containerContent"]["innerHTML"] = "";
      if (isObject(f2) && this["_htmlTemplate"]) {
        const g2 = template(this["_htmlTemplate"], f2, !![]);
        this["_containerContent"]["innerHTML"] = g2["toString"]();
      } else this["_containerContent"]["innerHTML"] = f2["toString"]();
    }
    this["showPopupElement"](), this["currentWindowPosition"] = a$b["SceneTransforms"]["worldToWindowCoordinates"](this["_viewer"]["scene"], this["currentCartesian"]) ?? a$b["Cartesian2"]["ZERO"], this["emit"]("openPopup", { "id": this["id"], "popup": this, "info": { "showData": f2, "cartesian": this["currentCartesian"], "windowPosition": this["currentWindowPosition"] } });
  }
  ["close"]() {
    this["hidePopupElement"](), this["_entity"] && (this["_entity"]["show"] = ![]), this["emit"]("closePopup", { "id": this["id"], "popup": this });
  }
  ["destroy"]() {
    this["close"](), this["_container"] && this["_container"]["parentNode"] && this["viewerContainer"]["removeChild"](this["_container"]), this["_entity"] && (this["_viewer"]["entities"]["remove"](this["_entity"]), this["_entity"] = void 0), this["_unbindPostRender"](), this["emit"]("destroyPopup", { "id": this["id"], "popup": this }), super["destroy"](!![]);
  }
  ["emit"](d2, e2) {
    return super["emit"](d2, e2, !![]);
  }
  ["on"](d2, e2, f2) {
    return super["on"](d2, e2, f2);
  }
  ["off"](d2, e2, f2) {
    return super["off"](d2, e2, f2);
  }
}
__publicField(Popup, "EventType", { ...pick(EventType, ["openPopup", "closePopup", "destroyPopup", "changePopupPosition", "showPopupElement", "hidePopupElement"]) });
class BaseLayer extends BaseClass {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_show");
    __publicField(this, "_state", State["CREATED"]);
    __publicField(this, "_initCompleted");
    __publicField(this, "_eventCacheSet", /* @__PURE__ */ new Set());
    __publicField(this, "_popup");
    __publicField(this, "_earth");
    __publicField(this, "options");
    __publicField(this, "parent");
    this["options"] = b2, this["options"]["id"] = a$b["defaultValue"](b2["id"], this["uuid"]), this["options"]["pid"] = a$b["defaultValue"](b2["pid"], -1), this["options"]["name"] = a$b["defaultValue"](b2["name"], this["uuid"]), this["_show"] = a$b["defaultValue"](b2["show"], !![]), this["options"]["onClick"] = a$b["defaultValue"](this["options"]["onClick"], (c2, d2) => {
      var _a;
      (_a = c2["popup"]) == null ? void 0 : _a["open"](d2["data"]["cartesian"]);
    }), this["bindClickEvent"](this["options"]["onClick"]), this["on"](EventType["click"], (c2) => {
      this["_eventCacheSet"]["forEach"]((d2) => {
        d2(this, c2);
      });
    });
  }
  get ["id"]() {
    return this["options"]["id"];
  }
  get ["pid"]() {
    return this["options"]["pid"];
  }
  get ["name"]() {
    return this["options"]["name"];
  }
  get ["earth"]() {
    return this["_earth"];
  }
  get ["viewer"]() {
    var _a;
    return (_a = this["_earth"]) == null ? void 0 : _a["viewer"];
  }
  get ["popup"]() {
    return this["_popup"];
  }
  get ["type"]() {
    return this["_type"];
  }
  get ["state"]() {
    return this["_state"];
  }
  get ["show"]() {
    return this["_show"];
  }
  set ["show"](b2) {
    this["setShow"](b2);
  }
  async ["_onAdd"](b2) {
    if (this["_state"] == State["ADDED"]) return;
    this["_earth"] = b2, this["options"]["eventParent"] !== ![] && (this["options"]["eventParent"] ? this["addEventParent"](this["options"]["eventParent"]) : this["addEventParent"](b2)), !this["_initCompleted"] && (this["_initHooks"](), a$b["defined"](this["options"]["popup"]) && this["bindPopup"](this["viewer"], this["options"]["popup"]), this["_initCompleted"] = !![], this["_state"] = State["INITED"]), await this["_addHooks"](), this["_state"] = State["ADDED"], this["options"]["flyTo"] && this["flyTo"](), this["emit"](EventType["add"], { "layer": this }, !![]), this["emit"](EventType["addLayer"], { "layer": this }, !![]);
  }
  ["_onRemove"]() {
    if (this["_state"] == State["REMOVED"]) return;
    if (!this["_earth"]) return;
    this["_removeHooks"](), this["_state"] = State["REMOVED"], this["emit"](EventType["remove"], { "layer": this }, !![]), this["emit"](EventType["removeLayer"], { "layer": this }, !![]);
    if (this["options"]["eventParent"]) this["removeEventParent"](this["options"]["eventParent"]);
    else {
      if (this["options"]["eventParent"] === ![]) ;
      else this["removeEventParent"](this["_earth"]);
    }
    this["_earth"] = void 0;
  }
  ["setShow"](b2) {
    if (this["_show"] == b2 || this["_state"] == State["DESTROYED"]) return;
    this["options"]["show"] = b2, this["_show"] = b2, this["layerSource"] && (Array["isArray"](this["layerSource"]) ? this["layerSource"]["forEach"]((c2) => {
      c2["show"] = b2;
    }) : this["layerSource"]["show"] = b2), this["state"] == State["ADDED"] && (this["_showHooks"](b2), b2 ? this["emit"](EventType["show"], { "layer": this }, !![]) : this["emit"](EventType["hide"], { "layer": this }, !![]));
  }
  ["flyTo"](b2) {
    if (!this["_earth"]) return;
    this["_earth"]["cancelFlyTo"]();
    if (this["options"]["homeVision"]) this["_earth"]["flyTo"]({ ...this["options"]["homeVision"], ...b2 });
    else {
      if (this["getRectangle"]) {
        const c2 = this["getRectangle"](!![]);
        c2 && this["_earth"]["flyToExtent"](c2, { ...b2 });
      } else this["options"]["onCenterAt"] && this["options"]["onCenterAt"](b2);
    }
  }
  ["toJSON"]() {
    const b2 = deepClone(this["options"], ["parent", "eventParent"]);
    return b2["type"] = this["type"], b2["show"] = this["show"], this["_toJsonHooks"](b2), b2;
  }
  ["addTo"](b2) {
    b2 && b2["addLayer"] && b2["addLayer"](this);
  }
  ["removeTo"](b2 = !![]) {
    this["_earth"] && this["_earth"]["removeLayer"](this, b2);
  }
  ["addedPromise"]() {
    return new Promise((b2) => {
      let c2 = setInterval(() => {
        this["state"] == State["ADDED"] && (clearInterval(c2), c2 = void 0, b2(this));
      }, 100);
    });
  }
  ["bindClickEvent"](b2) {
    !this["_eventCacheSet"]["has"](b2) && this["_eventCacheSet"]["add"](b2);
  }
  ["unbindClickEvent"](b2) {
    if (!b2) {
      this["_eventCacheSet"]["clear"]();
      return;
    }
    this["_eventCacheSet"]["has"](b2) && this["_eventCacheSet"]["delete"](b2);
  }
  ["bindPopup"](b2, c2) {
    var _a;
    b2 ? ((_a = this["_popup"]) == null ? void 0 : _a["destroy"](), this["_popup"] = new Popup(b2, c2), this["_popup"]["addEventParent"](this)) : handlerError("NOT_THROW", "绑定弹窗需要传入Cesium.Viewer实例");
  }
  ["unbindPopup"]() {
    var _a;
    (_a = this["_popup"]) == null ? void 0 : _a["destroy"](), this["_popup"] = void 0;
  }
  ["destroy"]() {
    this["_state"] != State["REMOVED"] && this["removeTo"](), this["_destroyHooks"](), super["destroy"](), this["_state"] = State["DESTROYED"];
  }
}
__publicField(BaseLayer, "EventType", { ...pick(EventType, ["add", "addLayer", "remove", "removeLayer", "show", "hide"]), ...Popup["EventType"] });
const OptsConverClass = {};
function registerOptsConver(b2, c2) {
  OptsConverClass[b2] && handlerError("NOT_THROW", "registerOptsConver: " + b2 + "类型已存在"), OptsConverClass[b2] = c2;
}
const MaterialClass = {};
function registerMaterial(b2, c2) {
  MaterialClass[b2] && handlerError("NOT_THROW", "registerMaterial: " + b2 + "类型已存在"), MaterialClass[b2] = c2;
}
const MaterialPropertyClass = {};
function registerProperty(b2, c2) {
  MaterialPropertyClass[b2] && handlerError("NOT_THROW", "registerProperty: " + b2 + "属性类型已存在"), MaterialPropertyClass[b2] = c2;
}
function createMaterial(b2, c2) {
  if (!b2) {
    handlerError("NOT_THROW", "createMaterial：请指定MaterialType类型");
    return;
  }
  const d2 = OptsConverClass[b2] || OptsConverClass["default"];
  d2 && (c2["materialType"] = b2, c2 = d2["toCesiumVal"](c2));
  let e2;
  const f2 = MaterialClass[b2];
  return f2 ? e2 = new f2(c2) : e2 = a$b["Material"]["fromType"](b2, c2), e2["options"] = c2, e2["_pie3d_type"] = b2, e2;
}
function createMaterialProperty(b2, c2) {
  const d2 = MaterialPropertyClass[b2];
  if (d2) {
    const e2 = OptsConverClass[b2] || OptsConverClass["default"];
    e2 && (c2["materialType"] = b2, c2 = e2["toCesiumVal"](c2, {}, !![]));
    const f2 = new d2(c2);
    return f2["_pie3d_type"] = b2, f2["options"] = c2, f2;
  } else handlerError("NOT_THROW", "createMaterialProperty: 未找到该类型的对应材质属性");
}
function toJSON(b2, c2 = {}) {
  var _a;
  let d2;
  if (b2["_pie3d_type"]) d2 = b2["_pie3d_type"];
  else {
    if ((_a = b2 == null ? void 0 : b2["_template"]) == null ? void 0 : _a["type"]) d2 = b2["_template"]["type"];
    else (b2 == null ? void 0 : b2["getType"]) && (d2 = b2["getType"]());
  }
  !d2 && (b2 instanceof a$b["Color"] ? d2 = "Color" : handlerError("NOT_THROW", "toJSON: 未识别的材质类型"));
  const e2 = OptsConverClass[d2] || OptsConverClass["default"];
  return e2 && (c2["materialType"] = d2, e2["toJSON"](b2, c2)), c2;
}
const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  createMaterial,
  createMaterialProperty,
  registerMaterial,
  registerOptsConver,
  registerProperty,
  toJSON
}, Symbol.toStringTag, { value: "Module" }));
class ColorPatternGradientLayer extends BaseLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "colorPatternGradient");
    __publicField(this, "_primitiveCollection");
    __publicField(this, "_colorPatternGradientPrimitive");
    __publicField(this, "_colorRamp");
    __publicField(this, "_rectangle");
    __publicField(this, "_aboveGround");
    __publicField(this, "_height");
    __publicField(this, "_uniforms");
    __publicField(this, "options");
    this["options"] = b2, !b2["colorRamp"] && handlerError("THROW", 'Constructor: 构造参数未传入色带数组 "colorRamp"，该项为必传项'), this["_colorRamp"] = b2["colorRamp"], this["_aboveGround"] = a$b["defaultValue"](this["options"]["aboveGround"], ![]), this["_height"] = a$b["defaultValue"](this["options"]["height"], 0), this["_rectangle"] = parseRectangle(this["options"]["rectangle"]) ?? a$b["Rectangle"]["MAX_VALUE"], !b2["uniformOptions"]["image"] && handlerError("THROW", 'Constructor: 构造参数未传入数值预报查询图片接口返回的基础图片 "uniformOptions.image"，该项为必传项'), this["_uniforms"] = this["_createUniforms"](this["options"]["uniformOptions"]);
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    return this["_primitiveCollection"];
  }
  get ["rectangle"]() {
    return this["_rectangle"];
  }
  get ["colorRamp"]() {
    return this["_colorRamp"];
  }
  set ["colorRamp"](b2) {
    this["setColorRamp"](b2);
  }
  async ["_initHooks"]() {
    !this["_primitiveCollection"] && (this["_primitiveCollection"] = new a$b["PrimitiveCollection"](), this["_primitiveCollection"]["show"] = this["show"]);
  }
  async ["_addHooks"]() {
    this["_colorPatternGradientPrimitive"] = this["_createColorPatternGradientPrimitive"](), this["_primitiveCollection"]["add"](this["_colorPatternGradientPrimitive"]), this["_earth"]["viewer"]["scene"]["primitives"]["add"](this["_primitiveCollection"]);
  }
  ["_removeHooks"]() {
    var _a;
    (_a = this["_earth"]) == null ? void 0 : _a["viewer"]["scene"]["primitives"]["remove"](this["_primitiveCollection"]);
  }
  ["_destroyHooks"]() {
    var _a;
    (_a = this["_primitiveCollection"]) == null ? void 0 : _a["removeAll"]();
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["_getImgByColorRamp"](b2, c2, d2, e2) {
    const f2 = document["createElement"]("canvas"), g2 = f2["getContext"]("2d");
    if (!g2) return;
    f2["width"] = 256, f2["height"] = 8;
    if (e2 !== "linear") {
      const h2 = g2["createLinearGradient"](0, 0, 256, 0);
      d2["forEach"]((i2) => {
        const { value: j2, color: k2 } = i2;
        h2["addColorStop"]((j2 - b2) / (c2 - b2), k2);
      }), g2["fillStyle"] = h2, g2["fillRect"](0, 0, 256, 8);
    } else {
      let i2 = 0;
      d2["forEach"]((j2, k2, l2) => {
        const { value: m2, color: n2 } = j2, o2 = (m2 - b2) / (c2 - b2) * 256;
        g2["fillStyle"] = n2, g2["fillRect"](i2, 0, o2 - i2, 8), i2 = o2, k2 === l2["length"] - 1 && g2["fillRect"](o2, 0, 256 - o2, 8);
      });
    }
    return f2["toDataURL"]("image/png");
  }
  ["_createUniforms"](b2) {
    const c2 = a$b["defaultValue"](b2["alpha"], 0.8), d2 = a$b["defaultValue"](b2["resultSize"], new a$b["Cartesian2"](2880, 1440)), e2 = this["_colorRamp"]["sort"]((h2, i2) => {
      return h2["value"] - i2["value"];
    })[0]["value"], f2 = this["_colorRamp"]["sort"]((h2, i2) => {
      return i2["value"] - h2["value"];
    })[0]["value"], g2 = callWithErrorHandling("THROW", "getImgByColorRamp: 生成基于颜色映射的图像失败", () => this["_getImgByColorRamp"](e2, f2, this["_colorRamp"]));
    return { "u_image": b2["image"], "u_colorImage": g2, "u_minValue": e2, "u_maxValue": f2, "u_alpha": c2, "u_resultSize": d2 };
  }
  ["_createColorPatternGradientPrimitive"]() {
    const b2 = this["_aboveGround"] ? a$b["GroundPrimitive"] : a$b["Primitive"], c2 = new b2({ "geometryInstances": new a$b["GeometryInstance"]({ "geometry": new a$b["RectangleGeometry"]({ "ellipsoid": a$b["Ellipsoid"]["WGS84"], "height": this["_aboveGround"] ? 0 : this["_height"], "rectangle": this["_rectangle"], "vertexFormat": a$b["EllipsoidSurfaceAppearance"]["VERTEX_FORMAT"] }) }), "appearance": new a$b["EllipsoidSurfaceAppearance"]({ "aboveGround": this["_aboveGround"] }) }), d2 = createMaterial(MaterialType["ColorPatternGradient"], { ...this["_uniforms"] });
    return d2 && (c2["appearance"]["material"] = d2), c2["_pie3d_layerId"] = this["uuid"], c2;
  }
  ["getRectangle"](b2) {
    const c2 = this["_rectangle"] ?? a$b["Rectangle"]["MAX_VALUE"];
    return b2 === !![] ? formatRectangle(c2) : c2;
  }
  ["getLegendImage"]() {
    const b2 = document["createElement"]("canvas"), c2 = b2["getContext"]("2d");
    if (!c2) return;
    const e2 = 256 / this["_colorRamp"]["length"], f2 = "10px serif", g2 = "white";
    let h2 = 256, j2 = 20, k2 = ![];
    const l2 = Math["PI"] / 4;
    for (let m2 = 0; m2 < this["_colorRamp"]["length"]; m2++) {
      c2["font"] = f2;
      const n2 = this["_colorRamp"][m2]["value"]["toString"](), o2 = c2["measureText"](n2)["width"];
      k2 = o2 > e2;
      if (k2) {
        h2 = 270, j2 = 45;
        break;
      }
    }
    b2["width"] = h2, b2["height"] = j2;
    for (let p2 = 0; p2 < this["_colorRamp"]["length"]; p2++) {
      c2["fillStyle"] = this["_colorRamp"][p2]["color"], c2["fillRect"](p2 * e2, 0, e2, 8);
      if (p2 < this["_colorRamp"]["length"] - 1) {
        c2["save"]();
        let q2 = (p2 + 1) * e2, r2 = 18;
        const s2 = this["_colorRamp"][p2]["value"]["toString"]();
        let t2 = 0;
        if (k2) c2["translate"](q2, r2), c2["rotate"](l2), q2 = 0, r2 = 0, t2 = 5;
        else {
          const u2 = c2["measureText"](s2)["width"];
          t2 = u2 / 2;
        }
        this["_colorRamp"]["length"] > 20 ? p2 % 3 == 0 && (c2["fillStyle"] = g2, c2["font"] = f2, c2["fillText"](s2, q2 - t2, r2)) : (c2["fillStyle"] = g2, c2["font"] = f2, c2["fillText"](s2, q2 - t2, r2)), c2["restore"]();
      }
    }
    return b2["toDataURL"]("image/png");
  }
  ["setColorRamp"](b2) {
    this["_colorRamp"] = b2;
    const c2 = this["_colorRamp"]["sort"]((f2, g2) => {
      return f2["value"] - g2["value"];
    })[0]["value"], d2 = this["_colorRamp"]["sort"]((f2, g2) => {
      return g2["value"] - f2["value"];
    })[0]["value"], e2 = callWithErrorHandling("THROW", "getImgByColorRamp: 生成基于颜色映射的图像失败", () => this["_getImgByColorRamp"](c2, d2, this["_colorRamp"]));
    this["_colorPatternGradientPrimitive"] && (this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_minValue"] = c2, this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_maxValue"] = d2, this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_colorImage"] = e2);
  }
  ["setUniforms"](b2) {
    Reflect["ownKeys"](b2)["forEach"]((c2) => {
      this["_uniforms"]["u_" + c2] = b2[c2], this["_colorPatternGradientPrimitive"] && (this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_" + c2] = this["_uniforms"]["u_" + c2]);
    });
  }
}
__publicField(ColorPatternGradientLayer, "EventType", { ...BaseLayer["EventType"] });
(function(a2) {
  if (a2["TextEncoder"] && a2["TextDecoder"]) return ![];
  function b2(d2 = "utf-8") {
    if (d2 !== "utf-8") throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('" + d2 + "') is invalid.");
  }
  Object["defineProperty"](b2["prototype"], "encoding", { "value": "utf-8" }), b2["prototype"]["encode"] = function(d2, e2 = { "stream": ![] }) {
    if (e2["stream"]) throw new Error("Failed to encode: the 'stream' option is unsupported.");
    let f2 = 0;
    const g2 = d2["length"];
    let i2 = 0, j2 = Math["max"](32, g2 + (g2 >> 1) + 7), k2 = new Uint8Array(j2 >> 3 << 3);
    while (f2 < g2) {
      let l2 = d2["charCodeAt"](f2++);
      if (l2 >= 55296 && l2 <= 56319) {
        if (f2 < g2) {
          const m2 = d2["charCodeAt"](f2);
          (m2 & 64512) === 56320 && (++f2, l2 = ((l2 & 1023) << 10) + (m2 & 1023) + 65536);
        }
        if (l2 >= 55296 && l2 <= 56319) continue;
      }
      if (i2 + 4 > k2["length"]) {
        j2 += 8, j2 *= 1 + f2 / d2["length"] * 2, j2 = j2 >> 3 << 3;
        const n2 = new Uint8Array(j2);
        n2["set"](k2), k2 = n2;
      }
      if ((l2 & 4294967168) === 0) {
        k2[i2++] = l2;
        continue;
      } else {
        if ((l2 & 4294965248) === 0) k2[i2++] = l2 >> 6 & 31 | 192;
        else {
          if ((l2 & 4294901760) === 0) k2[i2++] = l2 >> 12 & 15 | 224, k2[i2++] = l2 >> 6 & 63 | 128;
          else {
            if ((l2 & 4292870144) === 0) k2[i2++] = l2 >> 18 & 7 | 240, k2[i2++] = l2 >> 12 & 63 | 128, k2[i2++] = l2 >> 6 & 63 | 128;
            else continue;
          }
        }
      }
      k2[i2++] = l2 & 63 | 128;
    }
    return k2["slice"](0, i2);
  };
  function c2(d2 = "utf-8", e2 = { "fatal": ![] }) {
    if (d2 !== "utf-8") throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('" + d2 + "') is invalid.");
    if (e2["fatal"]) throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");
  }
  Object["defineProperty"](c2["prototype"], "encoding", { "value": "utf-8" }), Object["defineProperty"](c2["prototype"], "fatal", { "value": ![] }), Object["defineProperty"](c2["prototype"], "ignoreBOM", { "value": ![] }), c2["prototype"]["decode"] = function(d2, e2 = { "stream": ![] }) {
    if (e2["stream"]) throw new Error("Failed to decode: the 'stream' option is unsupported.");
    const f2 = new Uint8Array(d2);
    let g2 = 0;
    const h2 = f2["length"], i2 = [];
    while (g2 < h2) {
      const j2 = f2[g2++];
      if (j2 === 0) break;
      if ((j2 & 128) === 0) i2["push"](j2);
      else {
        if ((j2 & 224) === 192) {
          const k2 = f2[g2++] & 63;
          i2["push"]((j2 & 31) << 6 | k2);
        } else {
          if ((j2 & 240) === 224) {
            const l2 = f2[g2++] & 63, m2 = f2[g2++] & 63;
            i2["push"]((j2 & 31) << 12 | l2 << 6 | m2);
          } else {
            if ((j2 & 248) === 240) {
              const n2 = f2[g2++] & 63, o2 = f2[g2++] & 63, p2 = f2[g2++] & 63;
              let q2 = (j2 & 7) << 18 | n2 << 12 | o2 << 6 | p2;
              q2 > 65535 && (q2 -= 65536, i2["push"](q2 >>> 10 & 1023 | 55296), q2 = 56320 | q2 & 1023), i2["push"](q2);
            }
          }
        }
      }
    }
    return String["fromCharCode"]["apply"](null, i2);
  }, a2["TextEncoder"] = b2, a2["TextDecoder"] = c2;
})(typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : void 0);
function decode$1(a2, b2 = "utf8") {
  const c2 = new TextDecoder(b2);
  return c2["decode"](a2);
}
const encoder = new TextEncoder();
function encode$1(a2) {
  return encoder["encode"](a2);
}
const defaultByteLength = 1024 * 8, hostBigEndian = (() => {
  const a2 = new Uint8Array(4), b2 = new Uint32Array(a2["buffer"]);
  return !((b2[0] = 1) & a2[0]);
})(), typedArrays = { "int8": globalThis["Int8Array"], "uint8": globalThis["Uint8Array"], "int16": globalThis["Int16Array"], "uint16": globalThis["Uint16Array"], "int32": globalThis["Int32Array"], "uint32": globalThis["Uint32Array"], "uint64": globalThis["BigUint64Array"], "int64": globalThis["BigInt64Array"], "float32": globalThis["Float32Array"], "float64": globalThis["Float64Array"] };
class IOBuffer {
  constructor(a2 = defaultByteLength, b2 = {}) {
    let c2 = ![];
    typeof a2 === "number" ? a2 = new ArrayBuffer(a2) : (c2 = !![], this["lastWrittenByte"] = a2["byteLength"]);
    const d2 = b2["offset"] ? b2["offset"] >>> 0 : 0, e2 = a2["byteLength"] - d2;
    let f2 = d2;
    (ArrayBuffer["isView"](a2) || a2 instanceof IOBuffer) && (a2["byteLength"] !== a2["buffer"]["byteLength"] && (f2 = a2["byteOffset"] + d2), a2 = a2["buffer"]), c2 ? this["lastWrittenByte"] = e2 : this["lastWrittenByte"] = 0, this["buffer"] = a2, this["length"] = e2, this["byteLength"] = e2, this["byteOffset"] = f2, this["offset"] = 0, this["littleEndian"] = !![], this["_data"] = new DataView(this["buffer"], f2, e2), this["_mark"] = 0, this["_marks"] = [];
  }
  ["available"](a2 = 1) {
    return this["offset"] + a2 <= this["length"];
  }
  ["isLittleEndian"]() {
    return this["littleEndian"];
  }
  ["setLittleEndian"]() {
    return this["littleEndian"] = !![], this;
  }
  ["isBigEndian"]() {
    return !this["littleEndian"];
  }
  ["setBigEndian"]() {
    return this["littleEndian"] = ![], this;
  }
  ["skip"](a2 = 1) {
    return this["offset"] += a2, this;
  }
  ["back"](a2 = 1) {
    return this["offset"] -= a2, this;
  }
  ["seek"](a2) {
    return this["offset"] = a2, this;
  }
  ["mark"]() {
    return this["_mark"] = this["offset"], this;
  }
  ["reset"]() {
    return this["offset"] = this["_mark"], this;
  }
  ["pushMark"]() {
    return this["_marks"]["push"](this["offset"]), this;
  }
  ["popMark"]() {
    const a2 = this["_marks"]["pop"]();
    if (a2 === void 0) throw new Error("Mark stack empty");
    return this["seek"](a2), this;
  }
  ["rewind"]() {
    return this["offset"] = 0, this;
  }
  ["ensureAvailable"](a2 = 1) {
    if (!this["available"](a2)) {
      const b2 = this["offset"] + a2, c2 = b2 * 2, d2 = new Uint8Array(c2);
      d2["set"](new Uint8Array(this["buffer"])), this["buffer"] = d2["buffer"], this["length"] = this["byteLength"] = c2, this["_data"] = new DataView(this["buffer"]);
    }
    return this;
  }
  ["readBoolean"]() {
    return this["readUint8"]() !== 0;
  }
  ["readInt8"]() {
    return this["_data"]["getInt8"](this["offset"]++);
  }
  ["readUint8"]() {
    return this["_data"]["getUint8"](this["offset"]++);
  }
  ["readByte"]() {
    return this["readUint8"]();
  }
  ["readBytes"](a2 = 1) {
    return this["readArray"](a2, "uint8");
  }
  ["readArray"](a2, b2) {
    const c2 = typedArrays[b2]["BYTES_PER_ELEMENT"] * a2, d2 = this["byteOffset"] + this["offset"], e2 = this["buffer"]["slice"](d2, d2 + c2);
    if (this["littleEndian"] === hostBigEndian && b2 !== "uint8" && b2 !== "int8") {
      const g2 = new Uint8Array(this["buffer"]["slice"](d2, d2 + c2));
      g2["reverse"]();
      const h2 = new typedArrays[b2](g2["buffer"]);
      return this["offset"] += c2, h2["reverse"](), h2;
    }
    const f2 = new typedArrays[b2](e2);
    return this["offset"] += c2, f2;
  }
  ["readInt16"]() {
    const a2 = this["_data"]["getInt16"](this["offset"], this["littleEndian"]);
    return this["offset"] += 2, a2;
  }
  ["readUint16"]() {
    const a2 = this["_data"]["getUint16"](this["offset"], this["littleEndian"]);
    return this["offset"] += 2, a2;
  }
  ["readInt32"]() {
    const a2 = this["_data"]["getInt32"](this["offset"], this["littleEndian"]);
    return this["offset"] += 4, a2;
  }
  ["readUint32"]() {
    const a2 = this["_data"]["getUint32"](this["offset"], this["littleEndian"]);
    return this["offset"] += 4, a2;
  }
  ["readFloat32"]() {
    const a2 = this["_data"]["getFloat32"](this["offset"], this["littleEndian"]);
    return this["offset"] += 4, a2;
  }
  ["readFloat64"]() {
    const a2 = this["_data"]["getFloat64"](this["offset"], this["littleEndian"]);
    return this["offset"] += 8, a2;
  }
  ["readBigInt64"]() {
    const a2 = this["_data"]["getBigInt64"](this["offset"], this["littleEndian"]);
    return this["offset"] += 8, a2;
  }
  ["readBigUint64"]() {
    const a2 = this["_data"]["getBigUint64"](this["offset"], this["littleEndian"]);
    return this["offset"] += 8, a2;
  }
  ["readChar"]() {
    return String["fromCharCode"](this["readInt8"]());
  }
  ["readChars"](a2 = 1) {
    let b2 = "";
    for (let c2 = 0; c2 < a2; c2++) {
      b2 += this["readChar"]();
    }
    return b2;
  }
  ["readUtf8"](a2 = 1) {
    return decode$1(this["readBytes"](a2));
  }
  ["decodeText"](a2 = 1, b2 = "utf-8") {
    return decode$1(this["readBytes"](a2), b2);
  }
  ["writeBoolean"](a2) {
    return this["writeUint8"](a2 ? 255 : 0), this;
  }
  ["writeInt8"](a2) {
    return this["ensureAvailable"](1), this["_data"]["setInt8"](this["offset"]++, a2), this["_updateLastWrittenByte"](), this;
  }
  ["writeUint8"](a2) {
    return this["ensureAvailable"](1), this["_data"]["setUint8"](this["offset"]++, a2), this["_updateLastWrittenByte"](), this;
  }
  ["writeByte"](a2) {
    return this["writeUint8"](a2);
  }
  ["writeBytes"](a2) {
    this["ensureAvailable"](a2["length"]);
    for (let b2 = 0; b2 < a2["length"]; b2++) {
      this["_data"]["setUint8"](this["offset"]++, a2[b2]);
    }
    return this["_updateLastWrittenByte"](), this;
  }
  ["writeInt16"](a2) {
    return this["ensureAvailable"](2), this["_data"]["setInt16"](this["offset"], a2, this["littleEndian"]), this["offset"] += 2, this["_updateLastWrittenByte"](), this;
  }
  ["writeUint16"](a2) {
    return this["ensureAvailable"](2), this["_data"]["setUint16"](this["offset"], a2, this["littleEndian"]), this["offset"] += 2, this["_updateLastWrittenByte"](), this;
  }
  ["writeInt32"](a2) {
    return this["ensureAvailable"](4), this["_data"]["setInt32"](this["offset"], a2, this["littleEndian"]), this["offset"] += 4, this["_updateLastWrittenByte"](), this;
  }
  ["writeUint32"](a2) {
    return this["ensureAvailable"](4), this["_data"]["setUint32"](this["offset"], a2, this["littleEndian"]), this["offset"] += 4, this["_updateLastWrittenByte"](), this;
  }
  ["writeFloat32"](a2) {
    return this["ensureAvailable"](4), this["_data"]["setFloat32"](this["offset"], a2, this["littleEndian"]), this["offset"] += 4, this["_updateLastWrittenByte"](), this;
  }
  ["writeFloat64"](a2) {
    return this["ensureAvailable"](8), this["_data"]["setFloat64"](this["offset"], a2, this["littleEndian"]), this["offset"] += 8, this["_updateLastWrittenByte"](), this;
  }
  ["writeBigInt64"](a2) {
    return this["ensureAvailable"](8), this["_data"]["setBigInt64"](this["offset"], a2, this["littleEndian"]), this["offset"] += 8, this["_updateLastWrittenByte"](), this;
  }
  ["writeBigUint64"](a2) {
    return this["ensureAvailable"](8), this["_data"]["setBigUint64"](this["offset"], a2, this["littleEndian"]), this["offset"] += 8, this["_updateLastWrittenByte"](), this;
  }
  ["writeChar"](a2) {
    return this["writeUint8"](a2["charCodeAt"](0));
  }
  ["writeChars"](a2) {
    for (let b2 = 0; b2 < a2["length"]; b2++) {
      this["writeUint8"](a2["charCodeAt"](b2));
    }
    return this;
  }
  ["writeUtf8"](a2) {
    return this["writeBytes"](encode$1(a2));
  }
  ["toArray"]() {
    return new Uint8Array(this["buffer"], this["byteOffset"], this["lastWrittenByte"]);
  }
  ["_updateLastWrittenByte"]() {
    this["offset"] > this["lastWrittenByte"] && (this["lastWrittenByte"] = this["offset"]);
  }
}
const types = { "BYTE": 1, "CHAR": 2, "SHORT": 3, "INT": 4, "FLOAT": 5, "DOUBLE": 6 };
function num2str(a2) {
  switch (Number(a2)) {
    case types["BYTE"]:
      return "byte";
    case types["CHAR"]:
      return "char";
    case types["SHORT"]:
      return "short";
    case types["INT"]:
      return "int";
    case types["FLOAT"]:
      return "float";
    case types["DOUBLE"]:
      return "double";
    default:
      return "undefined";
  }
}
function num2bytes(a2) {
  switch (Number(a2)) {
    case types["BYTE"]:
      return 1;
    case types["CHAR"]:
      return 1;
    case types["SHORT"]:
      return 2;
    case types["INT"]:
      return 4;
    case types["FLOAT"]:
      return 4;
    case types["DOUBLE"]:
      return 8;
    default:
      return -1;
  }
}
function str2num(a2) {
  switch (String(a2)) {
    case "byte":
      return types["BYTE"];
    case "char":
      return types["CHAR"];
    case "short":
      return types["SHORT"];
    case "int":
      return types["INT"];
    case "float":
      return types["FLOAT"];
    case "double":
      return types["DOUBLE"];
    default:
      return -1;
  }
}
function readNumber(a2, b2) {
  if (a2 !== 1) {
    const c2 = new Array(a2);
    for (let d2 = 0; d2 < a2; d2++) {
      c2[d2] = b2();
    }
    return c2;
  } else return b2();
}
function readType(a2, b2, c2) {
  switch (b2) {
    case types["BYTE"]:
      return Array["from"](a2["readBytes"](c2));
    case types["CHAR"]:
      return trimNull(a2["readChars"](c2));
    case types["SHORT"]:
      return readNumber(c2, a2["readInt16"]["bind"](a2));
    case types["INT"]:
      return readNumber(c2, a2["readInt32"]["bind"](a2));
    case types["FLOAT"]:
      return readNumber(c2, a2["readFloat32"]["bind"](a2));
    case types["DOUBLE"]:
      return readNumber(c2, a2["readFloat64"]["bind"](a2));
    default:
      throw new Error("non valid type " + b2);
  }
}
function trimNull(a2) {
  if (a2["charCodeAt"](a2["length"] - 1) === 0) return a2["substring"](0, a2["length"] - 1);
  return a2;
}
function nonRecord(a2, b2) {
  const c2 = str2num(b2["type"]), d2 = b2["size"] / num2bytes(c2), e2 = new Array(d2);
  for (let f2 = 0; f2 < d2; f2++) {
    e2[f2] = readType(a2, c2, 1);
  }
  return e2;
}
function record(a2, b2, c2) {
  const d2 = str2num(b2["type"]), e2 = b2["size"] ? b2["size"] / num2bytes(d2) : 1, f2 = c2["length"], g2 = new Array(f2), h2 = c2["recordStep"];
  if (h2) for (let j2 = 0; j2 < f2; j2++) {
    const k2 = a2["offset"];
    g2[j2] = readType(a2, d2, e2), a2["seek"](k2 + h2);
  }
  else throw new Error("recordDimension.recordStep is undefined");
  return g2;
}
function notNetcdf(a2, b2) {
  if (a2) throw new TypeError("Not a valid NetCDF v3.x file: " + b2);
}
function padding(a2) {
  a2["offset"] % 4 !== 0 && a2["skip"](4 - a2["offset"] % 4);
}
function readName(a2) {
  const b2 = a2["readUint32"](), c2 = a2["readChars"](b2);
  return padding(a2), c2;
}
const ZERO = 0, NC_DIMENSION = 10, NC_VARIABLE = 11, NC_ATTRIBUTE = 12, NC_UNLIMITED = 0;
function header(a2, b2) {
  const c2 = { "version": b2 }, d2 = { "length": a2["readUint32"]() }, e2 = dimensionsList(a2);
  !Array["isArray"](e2) && (d2["id"] = e2["recordId"], d2["name"] = e2["recordName"], c2["dimensions"] = e2["dimensions"]);
  c2["globalAttributes"] = attributesList(a2);
  const f2 = variablesList(a2, d2 == null ? void 0 : d2["id"], b2);
  return !Array["isArray"](f2) && (c2["variables"] = f2["variables"], d2["recordStep"] = f2["recordStep"]), c2["recordDimension"] = d2, c2;
}
function dimensionsList(a2) {
  const b2 = {};
  let c2, d2;
  const e2 = a2["readUint32"]();
  let f2;
  if (e2 === ZERO) return notNetcdf(a2["readUint32"]() !== ZERO, "wrong empty tag for list of dimensions"), [];
  else {
    notNetcdf(e2 !== NC_DIMENSION, "wrong tag for list of dimensions");
    const g2 = a2["readUint32"]();
    f2 = new Array(g2);
    for (let h2 = 0; h2 < g2; h2++) {
      const i2 = readName(a2), j2 = a2["readUint32"]();
      j2 === NC_UNLIMITED && (c2 = h2, d2 = i2), f2[h2] = { "name": i2, "size": j2 };
    }
  }
  return c2 !== void 0 && (b2["recordId"] = c2), d2 !== void 0 && (b2["recordName"] = d2), b2["dimensions"] = f2, b2;
}
function attributesList(a2) {
  const b2 = a2["readUint32"]();
  let c2;
  if (b2 === ZERO) return notNetcdf(a2["readUint32"]() !== ZERO, "wrong empty tag for list of attributes"), [];
  else {
    notNetcdf(b2 !== NC_ATTRIBUTE, "wrong tag for list of attributes");
    const d2 = a2["readUint32"]();
    c2 = new Array(d2);
    for (let e2 = 0; e2 < d2; e2++) {
      const f2 = readName(a2), g2 = a2["readUint32"]();
      notNetcdf(g2 < 1 || g2 > 6, "non valid type " + g2);
      const h2 = a2["readUint32"](), i2 = readType(a2, g2, h2);
      padding(a2), c2[e2] = { "name": f2, "type": num2str(g2), "value": i2 };
    }
  }
  return c2;
}
function variablesList(a2, b2, c2) {
  const d2 = a2["readUint32"]();
  let e2 = 0, f2;
  if (d2 === ZERO) return notNetcdf(a2["readUint32"]() !== ZERO, "wrong empty tag for list of variables"), [];
  else {
    notNetcdf(d2 !== NC_VARIABLE, "wrong tag for list of variables");
    const g2 = a2["readUint32"]();
    f2 = new Array(g2);
    for (let h2 = 0; h2 < g2; h2++) {
      const i2 = readName(a2), j2 = a2["readUint32"](), k2 = new Array(j2);
      for (let q2 = 0; q2 < j2; q2++) {
        k2[q2] = a2["readUint32"]();
      }
      const l2 = attributesList(a2), m2 = a2["readUint32"]();
      notNetcdf(m2 < 1 && m2 > 6, "non valid type " + m2);
      const n2 = a2["readUint32"]();
      let o2 = a2["readUint32"]();
      c2 === 2 && (notNetcdf(o2 > 0, "offsets larger than 4GB not supported"), o2 = a2["readUint32"]());
      let p2 = ![];
      typeof b2 !== "undefined" && k2[0] === b2 && (e2 += n2, p2 = !![]), f2[h2] = { "name": i2, "dimensions": k2, "attributes": l2, "type": num2str(m2), "size": n2, "offset": o2, "record": p2 };
    }
  }
  return { "variables": f2, "recordStep": e2 };
}
function toString() {
  const a2 = [];
  a2["push"]("DIMENSIONS");
  for (const c2 of this["dimensions"]) {
    a2["push"]("  " + c2["name"]["padEnd"](30) + " = size: " + c2["size"]);
  }
  a2["push"](""), a2["push"]("GLOBAL ATTRIBUTES");
  for (const d2 of this["globalAttributes"]) {
    a2["push"]("  " + d2["name"]["padEnd"](30) + " = " + d2["value"]);
  }
  const b2 = JSON["parse"](JSON["stringify"](this["variables"]));
  a2["push"](""), a2["push"]("VARIABLES:");
  for (const e2 of b2) {
    e2["value"] = this["getDataVariable"](e2);
    let f2 = JSON["stringify"](e2["value"]);
    if (f2["length"] > 50) f2 = f2["substring"](0, 50);
    !isNaN(e2["value"]["length"]) && (f2 += " (length: " + e2["value"]["length"] + ")"), a2["push"]("  " + e2["name"]["padEnd"](30) + " = " + f2);
  }
  return a2["join"]("\n");
}
class NetCDFReader {
  constructor(a2) {
    this["toString"] = toString;
    const b2 = new IOBuffer(a2);
    b2["setBigEndian"](), notNetcdf(b2["readChars"](3) !== "CDF", "should start with CDF");
    const c2 = b2["readByte"]();
    notNetcdf(c2 > 2, "unknown version"), this["header"] = header(b2, c2), this["buffer"] = b2;
  }
  get ["version"]() {
    return this["header"]["version"] === 1 ? "classic format" : "64-bit offset format";
  }
  get ["recordDimension"]() {
    return this["header"]["recordDimension"];
  }
  get ["dimensions"]() {
    return this["header"]["dimensions"];
  }
  get ["globalAttributes"]() {
    return this["header"]["globalAttributes"];
  }
  ["getAttribute"](a2) {
    const b2 = this["globalAttributes"]["find"]((c2) => c2["name"] === a2);
    if (b2) return b2["value"];
    return null;
  }
  ["getDataVariableAsString"](a2) {
    const b2 = this["getDataVariable"](a2);
    if (b2) return b2["join"]("");
    return null;
  }
  get ["variables"]() {
    return this["header"]["variables"];
  }
  ["getDataVariable"](a2) {
    let b2;
    typeof a2 === "string" ? b2 = this["header"]["variables"]["find"]((c2) => {
      return c2["name"] === a2;
    }) : b2 = a2;
    if (b2 === void 0) throw new Error("Not a valid NetCDF v3.x file: variable not found");
    return this["buffer"]["seek"](b2["offset"]), b2["record"] ? record(this["buffer"], b2, this["header"]["recordDimension"]) : nonRecord(this["buffer"], b2);
  }
  ["dataVariableExists"](a2) {
    const b2 = this["header"]["variables"]["find"]((c2) => {
      return c2["name"] === a2;
    });
    return b2 !== void 0;
  }
  ["attributeExists"](a2) {
    const b2 = this["globalAttributes"]["find"]((c2) => c2["name"] === a2);
    return b2 !== void 0;
  }
}
var ColorPatternGridFS_default = "uniform vec2 u_line_width;\r\nuniform vec2 u_line_offset;\n\nuniform sampler2D u_texture_map;\r\nuniform float u_max_val;\r\nuniform float u_min_val;\r\nuniform float u_alpha;\r\nuniform vec3 u_size;\n\nin vec3 v_normal;\r\nin vec2 v_st;\r\nin float v_val;\n\nin vec3 v_positionEC;\n\nvoid main () {\n\n  vec2 st = v_st;\r\n  vec3 positionToEyeEC = -v_positionEC;\n\n  float scaledWidth = fract(u_size.s * st.s);  \n  scaledWidth = abs(scaledWidth - floor(scaledWidth) - u_line_offset.s);\r\n  float scaledHeight = fract(u_size.t * st.t);\r\n  scaledHeight = abs(scaledHeight - floor(scaledHeight) - u_line_offset.t);\r\n  \n  const float fuzz = 0.001;\n\n  float value;\r\n  #ifdef GL_OES_standard_derivatives\r\n    \n    vec2 thickness = (u_line_width * czm_pixelRatio) - 1.0;\r\n    \n    vec2 dx = abs(dFdx(st));\r\n    vec2 dy = abs(dFdy(st));\r\n    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * vec2(u_size.s, u_size.t);\r\n    value = min(\r\n      smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\r\n      smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)\r\n    );\n\n    \n    \n   \n  #else\n\n    vec2 range = 1.0 - (u_line_width * czm_pixelRatio * 0.05);\r\n    value = min(\r\n      1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\r\n      1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)\r\n    );\r\n  #endif\n\n  \n  \n  float dRim = 1.0 - abs(dot(v_normal, normalize(positionToEyeEC)));\r\n  float sRim = smoothstep(1.0, 1.0, dRim);\r\n  value *= (1.0 - sRim);\n\n  float valInRange = (v_val-u_min_val)/(u_max_val-u_min_val);\r\n  vec4 color = texture(u_texture_map, vec2(valInRange, 0.5));\n\n  \n  color.a = color.a * (1.0 * value * clamp(u_alpha, 0.0, 1.0));\n\n  vec4 newColor = czm_gammaCorrect(color);\n\n  out_FragColor = newColor;\n\n}";
var ColorPatternGridVS_default = "in float val;\r\nin vec3 position;\r\nin vec2 st;\r\nin vec3 normal;\n\nout vec3 v_position;\r\nout vec2 v_st;\r\nout float v_val;\r\nout vec3 v_normal;\r\nout vec3 v_positionEC;\n\nvoid main () {\n\n  v_position = position;\r\n  v_st = st;\r\n  v_val = val;\r\n  v_normal = normal;\n\n  v_positionEC = (czm_modelView * vec4(position,1.0)).xyz;\n\n  gl_Position= czm_modelViewProjection * vec4(position,1.0);\n\n}";
const encodedJs = "IWZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYub25tZXNzYWdlPXM9Pntjb25zdHtkYXRhOmV9PXMsdD1lLnNpemVbMF0sbz1lLnNpemVbMV0sbj1lLmF0dHJpYnV0ZXMucG9zaXRpb24udmFsdWVzLGk9ZS5hdHRyaWJ1dGVzLm5vcm1hbC52YWx1ZXMscj1lLmF0dHJpYnV0ZXMuc3QudmFsdWVzLGw9ZS5zb3VyY2Uuc2xpY2UoMCxlLnNpemVbMF0qZS5zaXplWzFdKSxhPWUuaW5kaWNlcyx1PVtdLGM9W10sZj1bXSxoPVtdLHA9W107Zm9yKGxldCB3PTA7dzxvO3crKylmb3IobGV0IHM9MDtzPHQ7cysrKXtjb25zdCBlPXMrdyp0LG89YS5zbGljZSg2KmUsNiplKzYpLGc9bFtlXSxtPVtnLGcsZyxnXSx6PUFycmF5LmZyb20obmV3IFNldChvKSk7aC5wdXNoKC4uLm0pLHouZm9yRWFjaCgocz0+e2NvbnN0IGU9W25bMypzXSxuWzMqcysxXSxuWzMqcysyXV0sdD1baVszKnNdLGlbMypzKzFdLGlbMypzKzJdXSxvPVtyWzIqc10sclsyKnMrMV1dO3UucHVzaCguLi5lKSxjLnB1c2goLi4udCksZi5wdXNoKC4uLm8pfSkpO2NvbnN0IGI9dS5sZW5ndGgvMztwLnB1c2goYi00LGItMixiLTMsYi0zLGItMixiLTEpfXNlbGYucG9zdE1lc3NhZ2Uoe25ld1Bvc2l0aW9uczp1LG5ld05vcm1hbHM6YyxuZXdTdHM6ZixuZXdDb2xvcnM6aCxuZXdJbmRpY2VzOnB9KX0sc2VsZi5vbmVycm9yPXM9PmNvbnNvbGUubG9nKHMpfSgpOwo=";
const decodeBase64 = (base64) => Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0));
const blob = typeof self !== "undefined" && self.Blob && new Blob([decodeBase64(encodedJs)], { type: "text/javascript;charset=utf-8" });
function WorkerWrapper(options) {
  let objURL;
  try {
    objURL = blob && (self.URL || self.webkitURL).createObjectURL(blob);
    if (!objURL) throw "";
    const worker = new Worker(objURL, {
      name: options == null ? void 0 : options.name
    });
    worker.addEventListener("error", () => {
      (self.URL || self.webkitURL).revokeObjectURL(objURL);
    });
    return worker;
  } catch (e2) {
    return new Worker(
      "data:text/javascript;base64," + encodedJs,
      {
        name: options == null ? void 0 : options.name
      }
    );
  } finally {
    objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);
  }
}
const DEFAULT_COLOR_RAMP = [{ "color": "#00FF00", "value": 0.5 }, { "color": "#FFFF00", "value": 2 }, { "color": "#FF0000", "value": 6 }];
const _ColorPatternGridPrimitive = class _ColorPatternGridPrimitive extends BaseClass {
  constructor(d2) {
    super(d2);
    __publicField(this, "_maxVal");
    __publicField(this, "_minVal");
    __publicField(this, "_alpha", 1);
    __publicField(this, "_interval", 0.5);
    __publicField(this, "_heightScale", 1);
    __publicField(this, "_extent", [90, 0, 150, 50]);
    __publicField(this, "_size", [0, 0, 0]);
    __publicField(this, "_height", 1e3);
    __publicField(this, "_extrudedHeight", 0);
    __publicField(this, "_source");
    __publicField(this, "_texture");
    __publicField(this, "_drawCommand");
    __publicField(this, "_geometry");
    __publicField(this, "_image");
    __publicField(this, "_isDestroyed", ![]);
    __publicField(this, "_worker", new WorkerWrapper({ "name": "CreateGeometryWorker" }));
    __publicField(this, "_colorRamp");
    __publicField(this, "_show");
    this["_extent"] = a$b["defaultValue"](d2["extent"], this["_extent"]), this["_height"] = a$b["defaultValue"](d2["height"], this["_height"]), this["_heightScale"] = a$b["defaultValue"](d2["heightScale"], this["_heightScale"]), this["_extrudedHeight"] = a$b["defaultValue"](d2["extrudedHeight"], this["_extrudedHeight"]), this["_size"] = a$b["defaultValue"](d2["size"], this["_size"]), this["_source"] = a$b["defaultValue"](d2["source"], this["_source"]), this["_interval"] = a$b["defaultValue"](d2["interval"], this["_interval"]), this["_maxVal"] = Math["max"](...this["_source"]), this["_minVal"] = Math["min"](...this["_source"]), this["_alpha"] = a$b["defaultValue"](d2["alpha"], this["_alpha"]), this["_colorRamp"] = a$b["defaultValue"](d2["colorRamp"], _ColorPatternGridPrimitive["DEFAULT_COLOR_RAMP"]), this["_show"] = a$b["defaultValue"](d2["show"], !![]);
    const e2 = this["_interval"] / 2;
    this["_extent"] = [this["_extent"][0] - e2, this["_extent"][1] - e2, this["_extent"][2] + e2, this["_extent"][3] + e2], this["_createGeometry"](), this["_image"] = this["_createColorRamp"]();
  }
  static ["getColorRamp"](d2, e2) {
    const f2 = e2;
    d2[d2["length"] - 1]["value"] = f2;
    const g2 = 100, h2 = 1, i2 = document["createElement"]("canvas");
    i2["width"] = g2, i2["height"] = h2;
    const j2 = i2["getContext"]("2d");
    let k2 = 0;
    return d2["forEach"]((m2) => {
      j2 && (j2["fillStyle"] = m2["color"]);
      const n2 = m2["value"], o2 = n2 / e2 * g2;
      j2 && j2["fillRect"](k2, 0, o2, h2), k2 += o2;
    }), i2;
  }
  get ["show"]() {
    return this["_show"];
  }
  set ["show"](d2) {
    this["setShow"](d2);
  }
  get ["alpha"]() {
    return this["_alpha"];
  }
  set ["alpha"](d2) {
    this["setAlpha"](d2);
  }
  get ["colorRamp"]() {
    return this["_colorRamp"];
  }
  set ["colorRamp"](d2) {
    this["setColorRamp"](d2);
  }
  get ["isDestroyed"]() {
    return this["_isDestroyed"];
  }
  ["_createColorRamp"]() {
    const d2 = _ColorPatternGridPrimitive["getColorRamp"](this["_colorRamp"], this["_maxVal"] - this["_minVal"]), e2 = new Image();
    return e2["src"] = d2["toDataURL"](), e2;
  }
  ["_createGeometry"]() {
    const { _extent: d2, _height: e2, _heightScale: f2, _extrudedHeight: g2 } = this, h2 = new a$b["RectangleGeometry"]({ "ellipsoid": a$b["Ellipsoid"]["WGS84"], "rectangle": a$b["Rectangle"]["fromDegrees"](...d2), "height": e2 * f2, "extrudedHeight": g2 * f2, "vertexFormat": new a$b["VertexFormat"]({ "position": !![], "st": !![], "normal": !![] }), "granularity": this["_interval"] / 180 * Math["PI"] }), i2 = a$b["RectangleGeometry"]["createGeometry"](h2);
    this["_worker"]["postMessage"]({ "source": this["_source"], "size": this["_size"], "attributes": i2 == null ? void 0 : i2["attributes"], "indices": i2 == null ? void 0 : i2["indices"] }), this["_worker"]["onmessage"] = (j2) => {
      const { newPositions: k2, newNormals: l2, newSts: m2, newColors: n2, newIndices: o2 } = j2["data"], p2 = Object["assign"]({}, i2 == null ? void 0 : i2["attributes"], { "color": new a$b["GeometryAttribute"]({ "componentDatatype": a$b["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 1, "values": new Float32Array(n2) }), "position": new a$b["GeometryAttribute"]({ "componentDatatype": a$b["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 3, "values": new Float32Array(k2) }), "normal": new a$b["GeometryAttribute"]({ "componentDatatype": a$b["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 3, "values": new Float32Array(l2) }), "st": new a$b["GeometryAttribute"]({ "componentDatatype": a$b["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 2, "values": new Float32Array(m2) }) });
      i2 && (i2["attributes"] = p2, i2["indices"] = o2), this["_geometry"] = i2, this["_worker"]["terminate"]();
    };
  }
  ["_createTexture"](d2) {
    return !this["_texture"] && (this["_texture"] = new a$b["Texture"]({ "context": d2, "pixelFormat": a$b["PixelFormat"]["RGBA"], "pixelDatatype": a$b["PixelDatatype"]["FLOAT"], "source": this["_image"] })), this["_texture"];
  }
  ["_createCommand"](d2) {
    if (!a$b["defined"](this["_geometry"])) return;
    const e2 = a$b["GeometryPipeline"]["createAttributeLocations"](this["_geometry"]), f2 = a$b["VertexArray"]["fromGeometry"]({ "context": d2, "geometry": this["_geometry"], "attributes": e2 }), g2 = a$b["RenderState"]["fromCache"]({ "depthTest": { "enabled": !![] }, "depthMask": { "enabled": !![] }, "blending": a$b["BlendingState"]["ALPHA_BLEND"] }), h2 = a$b["ShaderProgram"]["fromCache"]({ "context": d2, "vertexShaderSource": ColorPatternGridVS_default, "fragmentShaderSource": ColorPatternGridFS_default, "attributeLocations": e2 }), i2 = this, j2 = { "u_texture_map"() {
      return i2["_createTexture"](d2);
    }, "u_size"() {
      return new a$b["Cartesian3"](...i2["_size"]);
    }, "u_line_width"() {
      return new a$b["Cartesian2"](3, 3);
    }, "u_line_offset"() {
      return new a$b["Cartesian2"](0, 0);
    }, "u_min_val"() {
      return i2["_minVal"];
    }, "u_max_val"() {
      return i2["_maxVal"];
    }, "u_time"() {
      return performance["now"]() / 1e3;
    }, "u_alpha"() {
      return i2["_alpha"];
    }, "u_is_grid"() {
      return !![];
    } };
    this["_drawCommand"] = new a$b["DrawCommand"]({ "pass": a$b["Pass"]["OPAQUE"], "shaderProgram": h2, "renderState": g2, "vertexArray": f2, "uniformMap": j2, "primitiveType": a$b["PrimitiveType"]["TRIANGLES"] });
  }
  ["setShow"](d2) {
    this["_show"] = d2;
  }
  ["setAlpha"](d2) {
    this["_alpha"] = d2;
  }
  ["setColorRamp"](d2) {
    this["_colorRamp"] = d2, this["_image"] = this["_createColorRamp"](), this["_drawCommand"] = void 0, this["_texture"] = void 0;
  }
  ["update"](d2) {
    !this["_drawCommand"] && this["_createCommand"](d2["context"]), this["_show"] && this["_drawCommand"] && d2["commandList"]["push"](this["_drawCommand"]);
  }
  ["destroy"]() {
    this["_drawCommand"] = void 0, this["_worker"]["terminate"](), this["_isDestroyed"] = !![], super["destroy"]();
  }
};
__publicField(_ColorPatternGridPrimitive, "DEFAULT_COLOR_RAMP", DEFAULT_COLOR_RAMP);
let ColorPatternGridPrimitive = _ColorPatternGridPrimitive;
const _ColorPatternGridLayer = class _ColorPatternGridLayer extends BaseLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "colorPatternGrid");
    __publicField(this, "_primitiveCollection");
    __publicField(this, "_size");
    __publicField(this, "_levelList");
    __publicField(this, "_showLevel");
    __publicField(this, "_colorRamp");
    __publicField(this, "_rectangle");
    __publicField(this, "_alpha");
    __publicField(this, "options");
    __publicField(this, "ncFileResult");
    this["options"] = b2, this["_colorRamp"] = a$b["defaultValue"](this["options"]["colorRamp"], _ColorPatternGridLayer["DEFAULT_COLOR_RAMP"]), this["options"]["interval"] = a$b["defaultValue"](this["options"]["interval"], 0.5), this["options"]["heightScale"] = a$b["defaultValue"](this["options"]["heightScale"], 1), this["_alpha"] = a$b["defaultValue"](this["options"]["alpha"], 1);
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    return this["_primitiveCollection"];
  }
  get ["size"]() {
    return this["_size"];
  }
  get ["levelList"]() {
    return this["_levelList"];
  }
  get ["showLevel"]() {
    return this["_showLevel"];
  }
  set ["showLevel"](b2) {
    this["setShowLevel"](b2);
  }
  get ["colorRamp"]() {
    return this["_colorRamp"];
  }
  set ["colorRamp"](b2) {
    this["setColorRamp"](b2);
  }
  get ["alpha"]() {
    return this["_alpha"];
  }
  set ["alpha"](b2) {
    this["setAlpha"](b2);
  }
  get ["rectangle"]() {
    return this["_rectangle"];
  }
  async ["_initHooks"]() {
    !this["_primitiveCollection"] && (this["_primitiveCollection"] = new a$b["PrimitiveCollection"](), this["_primitiveCollection"]["show"] = this["show"]);
  }
  async ["_addHooks"]() {
    var _a, _b;
    const b2 = await this["_loadNcFile"](this["options"]["url"]);
    if (!b2) return;
    this["ncFileResult"] = b2;
    const { levArray: c2, valArray: d2, minx: e2, maxx: f2, miny: g2, maxy: h2, nx: j2, ny: k2, nz: l2 } = b2, m2 = [e2, g2, f2, h2];
    this["_rectangle"] = a$b["Rectangle"]["fromDegrees"](m2[0], m2[1], m2[2], m2[3]), this["_size"] = [j2, k2, l2], this["_levelList"] = Array["from"]({ "length": l2 })["map"]((n2, o2) => {
      return o2;
    });
    for (let n2 = 0; n2 < l2; n2++) {
      const o2 = j2 * k2, p2 = d2["slice"](o2 * n2, o2 * (n2 + 1)), q2 = this["_dealValues"](p2, j2, k2), r2 = new ColorPatternGridPrimitive({ "extent": m2, "source": q2, "size": [j2, k2, l2], "height": c2[n2], "show": this["options"]["show"], "colorRamp": this["options"]["colorRamp"], "heightScale": this["options"]["heightScale"], "interval": this["options"]["interval"] });
      (_a = this["_primitiveCollection"]) == null ? void 0 : _a["add"](r2);
    }
    (_b = this["_earth"]) == null ? void 0 : _b["viewer"]["scene"]["primitives"]["add"](this["_primitiveCollection"]), this["setShowLevel"](this["options"]["showLevel"]);
  }
  ["_removeHooks"]() {
    var _a;
    (_a = this["_earth"]) == null ? void 0 : _a["viewer"]["scene"]["primitives"]["remove"](this["_primitiveCollection"]);
  }
  ["_destroyHooks"]() {
    var _a;
    (_a = this["_primitiveCollection"]) == null ? void 0 : _a["removeAll"]();
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["_arrayToMap"](b2) {
    return b2["reduce"]((c2, d2) => {
      return c2[d2["name"]] = d2, c2;
    }, {});
  }
  ["_dealValues"](b2, c2, d2) {
    const e2 = [];
    for (let f2 = d2 - 1; f2 >= 0; f2--) {
      const g2 = b2["slice"](f2 * c2, (f2 + 1) * c2);
      e2["push"](...g2);
    }
    return new Float32Array(e2);
  }
  async ["_loadNcFile"](b2) {
    var _a;
    return await ((_a = a$b["Resource"]["fetchArrayBuffer"]({ "url": b2 })) == null ? void 0 : _a["then"]((c2) => {
      return callWithErrorHandling("THROW", '_loadNcFile("' + b2 + '")加载nc数据失败，请按照规范输入nc数据文件地址', () => {
        const d2 = new NetCDFReader(c2), e2 = this["_arrayToMap"](d2["dimensions"]), f2 = new Float32Array(d2["getDataVariable"]("lon")["flat"]()), g2 = new Float32Array(d2["getDataVariable"]("lat")["flat"]()), h2 = new Float32Array(d2["getDataVariable"]("level")["flat"]()), i2 = new Float32Array(d2["getDataVariable"]("value")["flat"]()), j2 = Math["min"](...f2), k2 = Math["max"](...f2), l2 = Math["min"](...g2), m2 = Math["max"](...g2), n2 = e2["lon"]["size"], o2 = e2["lat"]["size"], p2 = e2["level"]["size"];
        return { "lonArray": f2, "latArray": g2, "levArray": h2, "valArray": i2, "minx": j2, "maxx": k2, "miny": l2, "maxy": m2, "nx": n2, "ny": o2, "nz": p2 };
      });
    }));
  }
  ["getRectangle"](b2) {
    const c2 = this["_rectangle"] ?? a$b["Rectangle"]["MAX_VALUE"];
    return b2 === !![] ? formatRectangle(c2) : c2;
  }
  ["setShowLevel"](b2) {
    var _a;
    this["_showLevel"] = b2;
    if (this["_primitiveCollection"]) {
      if (!b2) for (let c2 = 0; c2 < this["_primitiveCollection"]["length"]; c2++) {
        const d2 = this["_primitiveCollection"]["get"](c2);
        d2 && (d2["show"] = !![]);
      }
      else {
        for (let e2 = 0; e2 < this["_primitiveCollection"]["length"]; e2++) {
          const f2 = this["_primitiveCollection"]["get"](e2);
          f2 && (f2["show"] = ![]);
        }
        (_a = this["_showLevel"]) == null ? void 0 : _a["forEach"]((g2) => {
          const h2 = this["_primitiveCollection"]["get"](g2);
          h2 && (h2["show"] = !![]);
        });
      }
    }
  }
  ["setColorRamp"](b2) {
    this["_colorRamp"] = b2;
    if (this["_primitiveCollection"]) for (let c2 = 0; c2 < this["_primitiveCollection"]["length"]; c2++) {
      const d2 = this["_primitiveCollection"]["get"](c2);
      d2["setColorRamp"](b2);
    }
  }
  ["setAlpha"](b2) {
    this["_alpha"] = b2;
    if (this["_primitiveCollection"]) for (let c2 = 0; c2 < this["_primitiveCollection"]["length"]; c2++) {
      const d2 = this["_primitiveCollection"]["get"](c2);
      d2["setAlpha"](b2);
    }
  }
};
__publicField(_ColorPatternGridLayer, "DEFAULT_COLOR_RAMP", DEFAULT_COLOR_RAMP);
let ColorPatternGridLayer = _ColorPatternGridLayer;
class GCJMercatorTilingScheme extends a$b["WebMercatorTilingScheme"] {
  constructor(b2) {
    super(b2);
    const c2 = b2["mapChinaCRS"], d2 = b2["chinaCRS"], e2 = getTransFun(c2, d2), f2 = getTransFun(d2, c2);
    if (e2) {
      const g2 = new a$b["WebMercatorProjection"]();
      this["_projection"]["project"] = function(h2, i2) {
        return i2 = e2([a$b["Math"]["toDegrees"](h2["longitude"]), a$b["Math"]["toDegrees"](h2["latitude"])]), i2 = g2["project"](new a$b["Cartographic"](a$b["Math"]["toRadians"](i2[0]), a$b["Math"]["toRadians"](i2[1]))), new a$b["Cartesian2"](i2["x"], i2["y"]);
      }, this["_projection"]["unproject"] = function(h2, i2) {
        const j2 = g2["unproject"](h2);
        return i2 = f2([a$b["Math"]["toDegrees"](j2["longitude"]), a$b["Math"]["toDegrees"](j2["latitude"])]), new a$b["Cartographic"](a$b["Math"]["toRadians"](i2[0]), a$b["Math"]["toRadians"](i2[1]));
      };
    }
  }
}
function createLayer(b2) {
  const c2 = LayerType[b2["type"]];
  if (c2) {
    const d2 = new c2(b2);
    return d2;
  } else return handlerError("NOT_THROW", ["createLayer: 无法获得" + b2["type"] + "类型的图层，请检查type参数是否正确", b2]), void 0;
}
function converTileLayerOptions(b2) {
  const c2 = {};
  for (const d2 in b2) {
    let e2 = b2[d2];
    if (e2 == null) continue;
    switch (d2) {
      case "crs":
        e2 = ("" + e2)["toUpperCase"]();
        if (e2 == CRS["EPSG4326"] || e2 == "4326" || e2 == "EPSG4326") c2["crs"] = CRS["EPSG4326"], c2["tilingScheme"] = new a$b["GeographicTilingScheme"]({ "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 2, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 });
        else e2 == CRS["EPSG4490"] || e2 == "4490" || e2 == "EPSG4490" ? (c2["crs"] = CRS["EPSG4490"], c2["tilingScheme"] = new a$b["GeographicTilingScheme"]({ "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 2, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 })) : (c2["crs"] = CRS["EPSG3857"], c2["tilingScheme"] = new a$b["WebMercatorTilingScheme"]({ "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 1, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 }));
        break;
      case "chinaCRS":
        b2["mapChinaCRS"] != b2["chinaCRS"] && (c2["tilingScheme"] = new GCJMercatorTilingScheme({ "mapChinaCRS": b2["mapChinaCRS"] || ChinaCRS["WGS84"], "chinaCRS": b2["chinaCRS"], "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 1, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 }));
        break;
      case "rectangle":
        a$b["defined"](e2) && a$b["defined"](e2["xmin"]) && a$b["defined"](e2["xmax"]) && a$b["defined"](e2["ymin"]) && a$b["defined"](e2["ymax"]) ? c2["rectangle"] = a$b["Rectangle"]["fromDegrees"](e2["xmin"], e2["ymin"], e2["xmax"], e2["ymax"]) : c2["rectangle"] = e2;
        break;
      case "bbox":
        c2["rectangle"] = a$b["Rectangle"]["fromDegrees"](e2[0], e2[1], e2[2], e2[3]);
        break;
      default:
        c2[d2] = e2;
        break;
    }
  }
  return c2["crs"] = a$b["defaultValue"](c2["crs"], CRS["EPSG3857"]), c2["crs"] == CRS["EPSG4490"] && c2["url"] && (c2["url"] = c2["url"]["replace"](new RegExp("\\{z\\}", "g"), "{z4490}"), c2["url"] = c2["url"]["replace"](new RegExp("\\{arc_z\\}", "g"), "{arc_z4490}"), c2["url"] = c2["url"]["replace"](new RegExp("\\{arc_Z\\}", "g"), "{arc_Z4490}")), b2["tms"] && (c2["url"] = c2["url"]["replace"](new RegExp("\\{y\\}", "g"), "{reverseY}")), c2;
}
const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  converTileLayerOptions,
  createLayer
}, Symbol.toStringTag, { value: "Module" }));
class GroupLayer extends BaseLayer {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_type", "group");
    __publicField(this, "_arrLayer", []);
    __publicField(this, "options");
    this["options"] = b2, this["_arrLayer"] = [];
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    return this["_arrLayer"];
  }
  get ["zIndex"]() {
    return this["options"]["zIndex"] ?? -1;
  }
  set ["zIndex"](b2) {
    this["setZIndex"](b2);
  }
  get ["length"]() {
    var _a, _b, _c;
    return a$b["defined"]((_a = this["options"]) == null ? void 0 : _a["layers"]) && ((_c = (_b = this["options"]) == null ? void 0 : _b["layers"]) == null ? void 0 : _c["length"]) > 0 ? this["options"]["layers"]["length"] : this["_arrLayer"]["length"];
  }
  get ["hasChildLayer"]() {
    return this["length"] > 0;
  }
  get ["hasEmptyGroup"]() {
    return this["length"] == 0;
  }
  async ["_initHooks"]() {
    const b2 = this["options"]["layers"];
    if (b2 && b2["length"] > 0) for (let c2 = 0; c2 < b2["length"]; c2++) {
      const d2 = b2[c2], e2 = createLayer({ ...d2, "isInternal": this["options"]["isInternal"], "eventParent": this });
      e2 && this["addLayer"](e2);
    }
  }
  async ["_addHooks"]() {
    this["eachLayer"]((b2) => {
      b2["options"]["eventParent"] = this, this["_earth"] && b2["_onAdd"](this["_earth"]);
    }, this);
  }
  ["_removeHooks"]() {
    this["eachLayer"]((b2) => {
      b2["_onRemove"]();
    }, this);
  }
  ["_destroyHooks"]() {
    this["eachLayer"]((b2) => {
      b2["destroy"]();
    }, this);
  }
  ["_showHooks"](b2) {
    this["eachLayer"]((c2) => {
      c2["show"] = b2;
    }, this);
  }
  ["_toJsonHooks"](b2) {
  }
  ["setZIndex"](b2) {
    this["options"]["zIndex"] = b2, this["eachLayer"]((c2) => {
      var _a;
      (_a = c2["setZIndex"]) == null ? void 0 : _a.call(c2, b2);
    }, this);
  }
  ["getRectangle"](b2) {
    let c2;
    const d2 = this["getChildLayers"]();
    return d2["forEach"]((e2) => {
      if (!e2["getRectangle"]) return;
      const f2 = e2["getRectangle"]();
      if (!a$b["defined"](f2)) return;
      c2 ? c2 = a$b["Rectangle"]["union"](f2, c2) : c2 = f2;
    }, this), b2 ? formatRectangle(c2) : c2;
  }
  ["addLayer"](b2) {
    var _a;
    b2["parent"] = this, b2["options"]["pid"] = this["id"], b2["options"]["eventParent"] = this, this["_arrLayer"]["push"](b2), this["state"] == State["ADDED"] && b2["state"] != State["ADDED"] ? (_a = this["_earth"]) == null ? void 0 : _a["addLayer"](b2) : (this["_earth"] && b2["removeEventParent"](this["_earth"]), b2["addEventParent"](this));
  }
  ["removeLayer"](b2) {
    b2["parent"] = void 0, b2["options"]["eventParent"] = this, b2["removeEventParent"](this);
    for (let c2 = 0; c2 < this["_arrLayer"]["length"]; c2++) {
      if (this["_arrLayer"][c2] == b2) return this["_arrLayer"]["splice"](c2, 1), !![];
    }
    this["_earth"] && b2["state"] == State["ADDED"] && this["_earth"]["removeLayer"](b2);
  }
  ["eachLayer"](b2, c2) {
    if (!this["_arrLayer"]) return;
    this["_arrLayer"]["forEach"]((d2) => {
      b2["call"](c2, d2);
    });
  }
  ["getChildLayers"]() {
    var _a;
    const b2 = this["_arrLayer"] || [];
    return (_a = this["_earth"]) == null ? void 0 : _a["eachLayer"]((c2) => {
      if (c2["pid"] !== this["id"]) return;
      if (this["_arrLayer"]["includes"](c2)) return;
      b2["push"](c2);
    }, this), b2;
  }
  ["getLayer"](b2) {
    const c2 = this["_arrLayer"];
    if (!this["_arrLayer"] || this["_arrLayer"]["length"] == 0) return;
    for (let d2 = 0, e2 = c2["length"]; d2 < e2; d2++) {
      const f2 = c2[d2];
      if (f2["uuid"] == b2 || f2["id"] == b2 || f2["name"] == b2) return f2;
    }
    return void 0;
  }
  ["hasLayer"](b2, c2) {
    for (let d2 = 0; d2 < this["_arrLayer"]["length"]; d2++) {
      const e2 = this["_arrLayer"][d2];
      if (c2 && e2 == c2) continue;
      if (e2["name"] == b2 || e2["id"] == b2) return !![];
    }
    return ![];
  }
}
__publicField(GroupLayer, "EventType", { ...BaseLayer["EventType"] });
const _TerrainLayer = class _TerrainLayer extends BaseLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "terrain");
    __publicField(this, "options");
    __publicField(this, "terrain");
    this["options"] = b2;
  }
  static async ["createTerrainProvider"](b2) {
    b2 = b2 || { "terrainType": TerrainType["ELLIPSOID"] }, b2["terrainType"] = b2["terrainType"] || TerrainType["ELLIPSOID"], b2["requestVertexNormals"] = a$b["defaultValue"](b2["requestVertexNormals"], !![]);
    let c2;
    if (b2["terrainType"] == TerrainType["ION"]) !isNumber(b2["source"]) && (b2["source"] = 1), c2 = await a$b["CesiumTerrainProvider"]["fromIonAssetId"](b2["source"], b2);
    else {
      c2 = _TerrainLayer["Ellipsoid"];
      if (b2["source"] && !isNumber(b2["source"])) switch (b2["terrainType"]) {
        case TerrainType["XYZ"]:
          c2 = await a$b["CesiumTerrainProvider"]["fromUrl"](b2["source"], b2);
          break;
        case TerrainType["ARCGIS"]:
          c2 = await a$b["ArcGISTiledElevationTerrainProvider"]["fromUrl"](b2["source"], b2);
          break;
        case TerrainType["VR"]:
          c2 = await a$b["VRTheWorldTerrainProvider"]["fromUrl"](b2["source"], b2);
          break;
        case TerrainType["ELLIPSOID"]:
          c2 = _TerrainLayer["Ellipsoid"];
          break;
        default:
          c2 = _TerrainLayer["Ellipsoid"], handlerError("NOT_THROW", "createTerrainProvider: 请输入有效的terrainType地形类型");
      }
      else c2 = _TerrainLayer["Ellipsoid"], handlerError("NOT_THROW", "createTerrainProvider: 请输入有效的source服务");
    }
    return c2;
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    var _a;
    return (_a = this["terrain"]) == null ? void 0 : _a["provider"];
  }
  ["_createTerrainProvider"](b2) {
    return _TerrainLayer["createTerrainProvider"](b2);
  }
  async ["_initHooks"]() {
    const b2 = this["_createTerrainProvider"](this["options"]);
    this["terrain"] = new a$b["Terrain"](b2), this["terrain"]["_pie3d_layerId"] = this["uuid"];
  }
  async ["_addHooks"]() {
    this["_earth"] && this["terrain"] && this["_earth"]["viewer"]["scene"]["setTerrain"](this["terrain"]), this["emit"](EventType["load"], { "terrain": this["terrain"] }, !![]);
  }
  ["_removeHooks"]() {
    var _a;
    this["_earth"] && ((_a = this["terrain"]) == null ? void 0 : _a["provider"]) && (this["_earth"]["viewer"]["terrainProvider"] = _TerrainLayer["Ellipsoid"]);
  }
  ["_destroyHooks"]() {
    this["terrain"] = void 0;
  }
  ["_showHooks"](b2) {
    b2 ? this["_addHooks"]() : this["_removeHooks"]();
  }
  ["_toJsonHooks"](b2) {
  }
  ["getRectangle"](b2) {
    return void 0;
  }
};
__publicField(_TerrainLayer, "EventType", { ...BaseLayer["EventType"], ...pick(EventType, ["load"]) });
__publicField(_TerrainLayer, "Ellipsoid", new a$b["EllipsoidTerrainProvider"]({ "ellipsoid": a$b["Ellipsoid"]["WGS84"] }));
let TerrainLayer = _TerrainLayer;
class BaseTileLayer extends BaseLayer {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_opacity");
    __publicField(this, "_proxy");
    __publicField(this, "_rectangle");
    __publicField(this, "_imageryLayer");
    __publicField(this, "options");
    this["options"] = b2, this["_opacity"] = a$b["defaultValue"](b2["opacity"], 1), a$b["defined"](b2["alpha"]) && (this["_opacity"] = b2["alpha"]), this["options"]["proxy"] && (isString(this["options"]["proxy"]) ? this["_proxy"] = new a$b["DefaultProxy"](this["options"]["proxy"]) : this["_proxy"] = this["options"]["proxy"]);
  }
  get ["isTile"]() {
    return !![];
  }
  get ["layerSource"]() {
    return this["_imageryLayer"];
  }
  get ["zIndex"]() {
    return this["options"]["zIndex"] ?? -1;
  }
  set ["zIndex"](b2) {
    this["setZIndex"](b2);
  }
  get ["imageryProvider"]() {
    var _a;
    return (_a = this["_imageryLayer"]) == null ? void 0 : _a["imageryProvider"];
  }
  get ["opacity"]() {
    return this["_opacity"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2);
  }
  get ["alpha"]() {
    return this["opacity"];
  }
  set ["alpha"](b2) {
    this["setAlpha"](b2);
  }
  get ["brightness"]() {
    var _a;
    return this["options"]["brightness"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["brightness"]);
  }
  set ["brightness"](b2) {
    this["setBrightness"](b2);
  }
  get ["contrast"]() {
    var _a;
    return this["options"]["contrast"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["contrast"]) || 1;
  }
  set ["contrast"](b2) {
    this["setContrast"](b2);
  }
  get ["hue"]() {
    var _a;
    return this["options"]["hue"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["hue"]) || 0;
  }
  set ["hue"](b2) {
    this["setHue"](b2);
  }
  get ["saturation"]() {
    var _a;
    return this["options"]["saturation"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["saturation"]) || 1;
  }
  set ["saturation"](b2) {
    this["setSaturation"](b2);
  }
  get ["gamma"]() {
    var _a;
    return this["options"]["gamma"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["gamma"]) || 1;
  }
  set ["gamma"](b2) {
    this["setGamma"](b2);
  }
  get ["rectangle"]() {
    return this["getRectangle"]();
  }
  set ["rectangle"](b2) {
    this["setRectangle"](b2);
  }
  async ["_initHooks"]() {
    const b2 = this["_createImageryProvider"]({ ...this["options"], "rectangle": this["rectangle"] });
    if (!a$b["defined"](b2)) return;
    const c2 = this["options"], d2 = { "show": this["show"], "alpha": this["opacity"], ...c2, "rectangle": this["rectangle"] };
    this["_imageryLayer"] = new a$b["ImageryLayer"](b2, d2), this["_imageryLayer"]["_pie3d_layerId"] = this["uuid"], this["_imageryLayer"]["_pie3d_config"] = this["options"];
  }
  async ["_addHooks"]() {
    var _a;
    !this["_imageryLayer"] && this["_initHooks"](), (_a = this["_earth"]) == null ? void 0 : _a["imageryLayers"]["add"](this["_imageryLayer"]), this["options"]["zIndex"] && (this["zIndex"] = this["options"]["zIndex"]), this["emit"](EventType["load"], this["_imageryLayer"], !![]);
  }
  ["_removeHooks"]() {
    var _a;
    this["_imageryLayer"] && ((_a = this["_earth"]) == null ? void 0 : _a["imageryLayers"]["remove"](this["_imageryLayer"], ![]));
  }
  ["_destroyHooks"]() {
    var _a;
    (_a = this["_imageryLayer"]) == null ? void 0 : _a["destroy"](), this["_imageryLayer"] = void 0;
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["setZIndex"](b2) {
    var _a, _b, _c, _d, _e;
    this["options"]["zIndex"] = b2;
    if (this["_imageryLayer"] == null || b2 == null) return;
    (_c = (_b = (_a = this["_earth"]) == null ? void 0 : _a["viewer"]) == null ? void 0 : _b["imageryLayers"]) == null ? void 0 : _c["raiseToTop"](this["_imageryLayer"]);
    const c2 = (_d = this["_earth"]) == null ? void 0 : _d["imageryLayersArr"];
    if (c2) for (let d2 = c2["length"] - 1; d2 >= 0; d2--) {
      const e2 = c2[d2];
      if (e2 == this["_imageryLayer"]) continue;
      const f2 = e2["_pie3d_config"];
      f2 && f2["zIndex"] && (b2 < f2["zIndex"] && ((_e = this["_earth"]) == null ? void 0 : _e["imageryLayers"]["lower"](this["_imageryLayer"])));
    }
  }
  ["setOpacity"](b2) {
    this["_opacity"] = b2, this["_imageryLayer"] && (this["_imageryLayer"]["alpha"] = b2);
  }
  ["setAlpha"](b2) {
    this["opacity"] = b2;
  }
  ["setBrightness"](b2) {
    this["options"]["brightness"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["brightness"] = b2;
  }
  ["setContrast"](b2) {
    this["options"]["contrast"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["contrast"] = b2;
  }
  ["setHue"](b2) {
    this["options"]["hue"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["hue"] = b2;
  }
  ["setSaturation"](b2) {
    this["options"]["saturation"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["saturation"] = b2;
  }
  ["setGamma"](b2) {
    this["options"]["gamma"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["gamma"] = b2;
  }
  ["setRectangle"](b2) {
    var _a, _b;
    this["_rectangle"] = b2 || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["getImageryRectangle"]()) || a$b["Rectangle"]["MAX_VALUE"], this["options"]["rectangle"] = this["_rectangle"], this["options"]["extent"] = formatRectangle(this["_rectangle"]), this["options"]["bbox"] = [this["options"]["extent"]["xmin"], this["options"]["extent"]["ymin"], this["options"]["extent"]["xmax"], this["options"]["extent"]["ymax"]], ((_b = this["_imageryLayer"]) == null ? void 0 : _b["imageryProvider"]["rectangle"]) && (this["_imageryLayer"]["imageryProvider"]["_rectangle"] = this["_rectangle"]);
  }
  ["getRectangle"](b2) {
    var _a, _b, _c, _d, _e, _f, _g, _h;
    const c2 = ((_a = this["options"]["bbox"]) == null ? void 0 : _a[0]) ?? ((_b = this["options"]["extent"]) == null ? void 0 : _b["xmin"]) ?? -180, d2 = ((_c = this["options"]["bbox"]) == null ? void 0 : _c[1]) ?? ((_d = this["options"]["extent"]) == null ? void 0 : _d["ymin"]) ?? -90, e2 = ((_e = this["options"]["bbox"]) == null ? void 0 : _e[2]) ?? ((_f = this["options"]["extent"]) == null ? void 0 : _f["xmax"]) ?? 180, f2 = ((_g = this["options"]["bbox"]) == null ? void 0 : _g[3]) ?? ((_h = this["options"]["extent"]) == null ? void 0 : _h["ymax"]) ?? 90, g2 = this["_rectangle"] ?? a$b["Rectangle"]["fromDegrees"](c2, d2, e2, f2);
    return b2 === !![] ? formatRectangle(g2) : g2;
  }
}
__publicField(BaseTileLayer, "EventType", { ...BaseLayer["EventType"], ...pick(EventType, ["load", "click"]) });
const _ImageLayer = class _ImageLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "options");
    __publicField(this, "_type", "image");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), !b2["tileWidth"] && (b2["tileWidth"] = 256), !b2["tileHeight"] && (b2["tileHeight"] = 256), new a$b["SingleTileImageryProvider"](b2);
  }
  ["_createImageryProvider"](b2) {
    return _ImageLayer["createImageryProvider"](b2);
  }
};
__publicField(_ImageLayer, "EventType", { ...BaseTileLayer["EventType"] });
let ImageLayer = _ImageLayer;
const _WmsLayer = class _WmsLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "options");
    __publicField(this, "capabilities");
    __publicField(this, "_type", "wms");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), new a$b["WebMapServiceImageryProvider"](b2);
  }
  ["_createImageryProvider"](b2) {
    return _WmsLayer["createImageryProvider"](b2);
  }
  async ["_addHooks"]() {
    a$b["defaultValue"](this["options"]["getCapabilities"], !![]) ? (await this["getMetadata"](), await super["_addHooks"]()) : await super["_addHooks"]();
  }
  ["_initByMetaData"](b2) {
    let c2 = this["options"]["layers"];
    c2["includes"](":") && (c2 = c2["split"](":")[1]);
    const d2 = this["_readChildNode"](b2, "Layer"), e2 = d2 == null ? void 0 : d2["getElementsByTagName"]("Layer");
    if (e2 == null ? void 0 : e2["length"]) for (let f2 = 0, g2 = e2["length"]; f2 < g2; f2++) {
      const h2 = e2[f2], j2 = this["_readChildNodeVal"](h2, "Name");
      if (j2 == c2) {
        const k2 = this["_readChildNodeVal"](h2, "CRS");
        !this["options"]["crs"] && k2 && (this["options"]["crs"] = k2);
        const l2 = this["_readChildNode"](h2, "BoundingBox");
        if (!this["options"]["rectangle"] && l2) {
          const m2 = Number(l2["getAttribute"]("minx")), n2 = Number(l2["getAttribute"]("miny")), o2 = Number(l2["getAttribute"]("maxx")), p2 = Number(l2["getAttribute"]("maxy")), q2 = { "xmin": m2, "ymin": n2, "xmax": o2, "ymax": p2 };
          this["options"]["extent"] = q2, this["_rectangle"] = a$b["Rectangle"]["fromDegrees"](q2["xmin"], q2["ymin"], q2["xmax"], q2["ymax"]);
        }
        break;
      }
    }
  }
  ["_readChildNode"](b2, c2) {
    if (!b2 || !c2) return null;
    const d2 = b2["getElementsByTagName"](c2);
    return d2["length"] > 0 ? d2[0] : null;
  }
  ["_readChildNodeVal"](b2, c2) {
    if (!b2 || !c2) return null;
    const d2 = this["_readChildNode"](b2, c2);
    if (d2 == null ? void 0 : d2["innerHTML"]) return d2["innerHTML"];
    else return (d2 == null ? void 0 : d2["getInnerHTML"]) ? d2["getInnerHTML"]() : null;
  }
  ["getMetadata"]() {
    return new Promise((b2, c2) => {
      var _a;
      if (this["capabilities"]) {
        b2(this["capabilities"]);
        return;
      }
      const d2 = { "service": "WMS", "request": "GetCapabilities", "version": "1.3.0" }, e2 = this["options"]["url"];
      (!e2 || typeof e2 != "string") && (handlerError("NOT_THROW", "getMetadata: 请在构造参数中输入url"), b2(void 0)), (_a = a$b["Resource"]["fetchXML"]({ ...this["options"], "url": e2, "queryParameters": d2, "proxy": this["_proxy"] })) == null ? void 0 : _a["then"]((f2) => {
        if (this["state"] == State["DESTROYED"]) return;
        if (f2) {
          this["capabilities"] = f2;
          try {
            this["_initByMetaData"](f2);
          } catch (g2) {
            handlerError("NOT_THROW", "getMetadata: WMS解析GetCapabilities有误", g2);
          }
        }
        b2(f2), this["emit"](EventType["loadConfig"], { "capabilities": f2 }, !![]);
      })["catch"]((f2) => {
        handlerError("NOT_THROW", "getMetadata: WMS请求出错", f2), b2(void 0);
      });
    });
  }
};
__publicField(_WmsLayer, "EventType", { ...BaseTileLayer["EventType"], ...pick(EventType, ["loadConfig"]) });
let WmsLayer = _WmsLayer;
const _WmtsLayer = class _WmtsLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "options");
    __publicField(this, "capabilities");
    __publicField(this, "_type", "wmts");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), b2["crs"] == CRS["EPSG4490"] && (b2["tileMatrixLabels"] = [...Array["from"]({ "length": 20 })["keys"]()]["map"]((c2) => (c2 + 1)["toString"]())), new a$b["WebMapTileServiceImageryProvider"](b2);
  }
  ["_createImageryProvider"](b2) {
    return _WmtsLayer["createImageryProvider"](b2);
  }
  async ["_addHooks"]() {
    a$b["defaultValue"](this["options"]["getCapabilities"], !![]) ? (await this["getMetadata"](), await super["_addHooks"]()) : await super["_addHooks"]();
  }
  ["_initByMetaData"](b2) {
    const c2 = this["_readChildNode"](b2, "Contents"), d2 = c2 == null ? void 0 : c2["getElementsByTagName"]("Layer");
    if (d2 == null ? void 0 : d2["length"]) for (let e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
      const g2 = d2[e2], h2 = this["_readChildNodeVal"](g2, "ows:Identifier");
      if (h2 == this["options"]["layer"] || this["options"]["layer"]["includes"](h2)) {
        const l2 = this["_readChildNode"](g2, "ows:WGS84BoundingBox");
        if (!this["options"]["rectangle"] && l2) {
          let n2 = this["_readChildNodeVal"](l2, "ows:LowerCorner"), o2 = this["_readChildNodeVal"](l2, "ows:UpperCorner");
          if (n2 && o2) {
            n2 = n2["split"](" "), o2 = o2["split"](" ");
            const p2 = Number(n2[0]), q2 = Number(n2[1]), r2 = Number(o2[0]), s2 = Number(o2[1]), t2 = { "xmin": p2, "ymin": q2, "xmax": r2, "ymax": s2 };
            this["options"]["extent"] = t2, this["_rectangle"] = a$b["Rectangle"]["fromDegrees"](t2["xmin"], t2["ymin"], t2["xmax"], t2["ymax"]);
          }
        }
        !a$b["defined"](this["options"]["style"]) && (this["options"]["style"] = this["_readChildNodeVal"](this["_readChildNode"](g2, "Style"), "ows:Identifier"));
        const m2 = g2["getElementsByTagName"]("TileMatrixSetLink");
        for (let u2 = 0, v2 = m2["length"]; u2 < v2; u2++) {
          const w2 = m2[u2], x2 = this["_readChildNodeVal"](w2, "TileMatrixSet");
          !a$b["defined"](this["options"]["tileMatrixSetID"]) && (this["options"]["tileMatrixSetID"] = x2);
          if (x2 == this["options"]["tileMatrixSetID"]) {
            if (!this["options"]["tileMatrixLabels"]) {
              const y2 = this["_readChildNode"](w2, "TileMatrixSetLimits"), z2 = y2 == null ? void 0 : y2["getElementsByTagName"]("TileMatrixLimits"), A5 = [];
              if (z2 == null ? void 0 : z2["length"]) for (let B2 = 0, C2 = z2["length"]; B2 < C2; B2++) {
                const D2 = this["_readChildNodeVal"](z2[B2], "TileMatrix");
                A5["push"](D2);
              }
              this["options"]["tileMatrixLabels"] = A5;
            }
            break;
          }
        }
        break;
      }
    }
  }
  ["_readChildNode"](b2, c2) {
    if (!b2 || !c2) return void 0;
    const d2 = b2["getElementsByTagName"](c2);
    return d2["length"] > 0 ? d2[0] : void 0;
  }
  ["_readChildNodeVal"](b2, c2) {
    if (!b2 || !c2) return void 0;
    const d2 = this["_readChildNode"](b2, c2);
    if (d2 == null ? void 0 : d2["innerHTML"]) return d2["innerHTML"];
    else return (d2 == null ? void 0 : d2["getInnerHTML"]) ? d2["getInnerHTML"]() : void 0;
  }
  ["getMetadata"]() {
    return new Promise((b2, c2) => {
      var _a;
      if (this["capabilities"]) {
        b2(this["capabilities"]);
        return;
      }
      const d2 = { "service": "WMTS", "request": "GetCapabilities", "version": "1.0.0" }, e2 = this["options"]["url"];
      (!e2 || typeof e2 != "string") && (handlerError("NOT_THROW", "getMetadata: 请在构造参数中输入url"), b2(void 0)), (_a = a$b["Resource"]["fetchXML"]({ ...this["options"], "url": e2, "queryParameters": d2, "proxy": this["_proxy"] })) == null ? void 0 : _a["then"]((f2) => {
        if (this["state"] == State["DESTROYED"]) return;
        if (f2) {
          this["capabilities"] = f2;
          try {
            this["_initByMetaData"](f2);
          } catch (g2) {
            handlerError("NOT_THROW", "getMetadata: WMTS解析GetCapabilities有误", g2);
          }
        }
        b2(f2), this["emit"](EventType["loadConfig"], { "capabilities": f2 }, !![]);
      })["catch"]((f2) => {
        handlerError("NOT_THROW", "getMetadata: WMTS请求出错", f2), b2(void 0);
      });
    });
  }
};
__publicField(_WmtsLayer, "EventType", { ...BaseTileLayer["EventType"], ...pick(EventType, ["loadConfig"]) });
let WmtsLayer = _WmtsLayer;
const _XyzLayer = class _XyzLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "options");
    __publicField(this, "_type", "xyz");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), b2["customTags"] = b2["customTags"] || {}, b2["customTags"]["host"] = function(c2, d2, e2, f2) {
      return location["host"];
    }, b2["customTags"]["hostname"] = function(c2, d2, e2, f2) {
      return location["hostname"];
    }, b2["customTags"]["z4490"] = function(c2, d2, e2, f2) {
      return f2 + 1;
    }, new a$b["UrlTemplateImageryProvider"](b2);
  }
  ["_createImageryProvider"](b2) {
    return _XyzLayer["createImageryProvider"](b2);
  }
};
__publicField(_XyzLayer, "EventType", { ...BaseTileLayer["EventType"] });
let XyzLayer = _XyzLayer;
const defaultSchema = { "id": "default", "type": "edge", "selectedColor": a$b["Color"]["CYAN"], "length": 0.01 };
class HighlightTileset {
  constructor(b2) {
    __publicField(this, "_viewer");
    __publicField(this, "_tileset");
    __publicField(this, "edgeCache");
    __publicField(this, "selected");
    __publicField(this, "highlightSchemaCache");
    this["_viewer"] = b2["viewer"], this["_tileset"] = b2["tileset"], this["highlightSchemaCache"] = {}, this["edgeCache"] = {}, this["selected"] = {};
    const c2 = b2["schema"] ?? {};
    b2["mergeSchema"] && Reflect["ownKeys"](defaultSchema)["forEach"]((d2) => {
      var _a;
      c2[d2] = ((_a = b2["schema"]) == null ? void 0 : _a[d2]) ?? defaultSchema[d2];
    }), this["addHighlightSchema"](c2);
  }
  ["addHighlightSchema"](b2) {
    this["highlightSchemaCache"][b2["id"]] = b2, this["selected"][b2["id"]] = [];
    const c2 = a$b["PostProcessStageLibrary"]["createEdgeDetectionStage"]();
    c2["uniforms"]["color"] = getCesiumColor(b2["selectedColor"], defaultSchema["selectedColor"]), c2["uniforms"]["length"] = isNumber(b2["length"]) ? b2["length"] : defaultSchema["length"], c2["selected"] = [], this["_viewer"]["scene"]["postProcessStages"]["add"](a$b["PostProcessStageLibrary"]["createSilhouetteStage"]([c2])), this["edgeCache"][b2["id"]] = c2;
  }
  ["updateHighlightSchema"](b2, c2 = !![]) {
    if (this["highlightSchemaCache"][b2["id"]]) {
      c2 && Reflect["ownKeys"](this["highlightSchemaCache"][b2["id"]])["forEach"]((f2) => {
        f2 != "id" && (b2[f2] = b2[f2] ?? this["highlightSchemaCache"][b2["id"]][f2]);
      });
      this["highlightSchemaCache"][b2["id"]] = b2;
      const d2 = this["selected"][b2["id"]] ?? [];
      d2["forEach"]((f2) => {
        this["closeHighlight"](f2, b2["id"]);
      }), this["_viewer"]["scene"]["postProcessStages"]["remove"](this["edgeCache"][b2["id"]]), this["edgeCache"][b2["id"]]["destroy"]();
      const e2 = a$b["PostProcessStageLibrary"]["createEdgeDetectionStage"]();
      e2["uniforms"]["color"] = getCesiumColor(b2["selectedColor"], defaultSchema["selectedColor"]), e2["uniforms"]["length"] = isNumber(b2["length"]) ? b2["length"] : defaultSchema["length"], e2["selected"] = [], this["_viewer"]["scene"]["postProcessStages"]["add"](a$b["PostProcessStageLibrary"]["createSilhouetteStage"]([e2])), d2["forEach"]((f2) => {
        this["openHighlight"](f2, b2["id"]);
      }), this["edgeCache"][b2["id"]] = e2;
    }
  }
  ["openHighlight"](b2, c2 = defaultSchema["id"], d2) {
    d2 && this["clearHighlight"](c2), this["selected"][c2]["push"](b2), this["highlightSchemaCache"][c2]["type"] == "edge" ? this["edgeCache"][c2]["selected"] = [...this["selected"][c2]] : b2["color"] = getCesiumColor(this["highlightSchemaCache"][c2]["selectedColor"]);
  }
  ["closeHighlight"](b2, c2 = defaultSchema["id"]) {
    const d2 = this["selected"][c2]["findIndex"]((e2) => {
      return b2["content"]["url"] + "__batchId__" + b2["featureId"] == e2["content"]["url"] + "__batchId__" + e2["featureId"];
    });
    d2 > -1 && (this["selected"][c2]["splice"](d2, 1), this["highlightSchemaCache"][c2]["type"] == "edge" ? this["edgeCache"][c2]["selected"] = [...this["selected"][c2]] : b2["color"] = a$b["Color"]["WHITE"]);
  }
  ["clearHighlight"](b2 = defaultSchema["id"]) {
    this["selected"][b2]["forEach"]((c2) => {
      this["closeHighlight"](c2, b2);
    });
  }
  ["clearAllHighlight"]() {
    for (const b2 in this["highlightSchemaCache"]) {
      this["clearHighlight"](b2);
    }
  }
  ["removeHighlightSchema"](b2) {
    this["clearHighlight"](b2), this["_viewer"]["scene"]["postProcessStages"]["remove"](this["edgeCache"][b2]), this["edgeCache"][b2]["destroy"](), Reflect["deleteProperty"](this["edgeCache"], b2), Reflect["deleteProperty"](this["highlightSchemaCache"], b2), Reflect["deleteProperty"](this["selected"], b2);
  }
  ["destroy"]() {
    for (const b2 in this["highlightSchemaCache"]) {
      this["removeHighlightSchema"](b2);
    }
    for (const c2 in this) {
      delete this[c2];
    }
  }
}
class TilesetLayer extends BaseLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "tileset");
    __publicField(this, "_tileset");
    __publicField(this, "_originRotation", { "x": 0, "y": 0, "z": 0 });
    __publicField(this, "_originCenterPoint", new LatLngPoint());
    __publicField(this, "_originCenterPosition", new a$b["Cartesian3"]());
    __publicField(this, "_originMatrix");
    __publicField(this, "_center", new LatLngPoint());
    __publicField(this, "_opacity");
    __publicField(this, "_styleCallback");
    __publicField(this, "_isBindTileVisible", ![]);
    __publicField(this, "_primaryKey", "id");
    __publicField(this, "_propertiesCache", {});
    __publicField(this, "_highlightAll", ![]);
    __publicField(this, "_styleCache");
    __publicField(this, "options");
    __publicField(this, "highlight");
    this["options"] = b2, this["_opacity"] = a$b["defaultValue"](b2["opacity"], 1);
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    return this["_tileset"];
  }
  get ["defaultTilesetOptimizeOptions"]() {
    return { "maximumScreenSpaceError": 64, "cacheBytes": 2147483648, "maximumCacheOverflowBytes": 1073741824, "cullRequestsWhileMovingMultiplier": 100, "skipLevelOfDetail": !![], "immediatelyLoadDesiredLevelOfDetail": !![], "progressiveResolutionHeightFraction": 0.1 };
  }
  get ["tileset"]() {
    return this["_tileset"];
  }
  get ["hasTransform"]() {
    var _a, _b;
    return ((_a = this["_tileset"]) == null ? void 0 : _a["root"]) && ((_b = this["_tileset"]["root"]) == null ? void 0 : _b["transform"]);
  }
  get ["boundingSphere"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["boundingSphere"];
  }
  get ["asset"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["asset"];
  }
  get ["properties"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["properties"];
  }
  get ["totalMemoryUsageInBytes"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["totalMemoryUsageInBytes"];
  }
  get ["originCenterPoint"]() {
    return this["_originCenterPoint"];
  }
  get ["originCenterPosition"]() {
    return this["_originCenterPosition"];
  }
  get ["position"]() {
    return this["_center"]["toCartesian"]();
  }
  get ["center"]() {
    return this["_center"];
  }
  get ["height"]() {
    if (this["_center"]) return this["_center"]["alt"];
    return 0;
  }
  set ["height"](b2) {
    this["setHeight"](b2);
  }
  get ["rotation"]() {
    if (this["options"]["rotation"]) return this["options"]["rotation"];
    return this["_originRotation"];
  }
  set ["rotation"](b2) {
    this["setRotation"](b2);
  }
  get ["rotation_x"]() {
    if (this["options"]["rotation"] && a$b["defined"](this["options"]["rotation"]["x"])) return this["options"]["rotation"]["x"];
    return this["_originRotation"]["x"];
  }
  set ["rotation_x"](b2) {
    this["setRotationX"](b2);
  }
  get ["rotation_y"]() {
    if (this["options"]["rotation"] && a$b["defined"](this["options"]["rotation"]["y"])) return this["options"]["rotation"]["y"];
    return this["_originRotation"]["y"];
  }
  set ["rotation_y"](b2) {
    this["setRotationY"](b2);
  }
  get ["rotation_z"]() {
    if (this["options"]["rotation"] && a$b["defined"](this["options"]["rotation"]["z"])) return this["options"]["rotation"]["z"];
    return this["_originRotation"]["z"];
  }
  set ["rotation_z"](b2) {
    this["setRrotationZ"](b2);
  }
  get ["axis"]() {
    return this["options"]["axis"];
  }
  set ["axis"](b2) {
    this["setAxis"](b2);
  }
  get ["scale"]() {
    return this["options"]["scale"] || 1;
  }
  set ["scale"](b2) {
    this["setScale"](b2);
  }
  get ["opacity"]() {
    return this["_opacity"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2);
  }
  get ["style"]() {
    return this["options"]["style"];
  }
  set ["style"](b2) {
    this["setStyle"](b2);
  }
  get ["customShader"]() {
    return this["options"]["customShader"];
  }
  set ["customShader"](b2) {
    this["setCustomShader"](b2);
  }
  set ["center"](b2) {
    this["setCenter"](b2);
  }
  get ["allowDrillPick"]() {
    return this["options"]["allowDrillPick"];
  }
  set ["allowDrillPick"](b2) {
    this["options"]["allowDrillPick"] = b2;
  }
  async ["_initHooks"]() {
  }
  async ["_addHooks"]() {
    callWithErrorHandling("THROW", "三维模型加载出错，请检查source等构造参数", async () => {
      const b2 = await this["_createCesium3DTileset"]();
      if (!b2) throw new Error("三维模型加载出错，请检查source等构造参数");
      this["_tileset"] = b2, this["_tileset"]["name"] = this["name"], this["_tileset"]["_pie3d_layerId"] = this["uuid"], this["_earth"]["viewer"]["scene"]["primitives"]["add"](this["_tileset"]), this["_tileset"]["initialTilesLoaded"]["addEventListener"]((c2) => {
        this["emit"](EventType["initialTilesLoaded"], c2);
      }), this["_tileset"]["allTilesLoaded"]["addEventListener"]((c2) => {
        this["emit"](EventType["allTilesLoaded"], c2);
      }), this["_tileset"]["show"] = this["show"], this["_tileset"]["colorBlendMode"] = a$b["Cesium3DTileColorBlendMode"]["REPLACE"], this["_init"]();
    });
  }
  ["_removeHooks"]() {
    this["_tileset"] && (this["_destroyHighlight"](), this["_earth"]["viewer"]["scene"]["primitives"]["remove"](this["_tileset"]));
  }
  ["_destroyHooks"]() {
    var _a;
    (_a = this["_tileset"]) == null ? void 0 : _a["destroy"](), this["_tileset"] = void 0;
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["_createCesium3DTileset"]() {
    if (typeof this["options"]["source"] == "number") {
      const b2 = this["options"]["source"];
      return a$b["Cesium3DTileset"]["fromIonAssetId"](b2, this["options"]);
    } else {
      const c2 = this["options"]["source"];
      return a$b["Cesium3DTileset"]["fromUrl"](c2, this["options"]);
    }
  }
  ["_bindTileVisibleEvent"]() {
    var _a;
    !this["_isBindTileVisible"] && ((_a = this["_tileset"]) == null ? void 0 : _a["tileVisible"]["addEventListener"](this["_updateTile"], this), this["_isBindTileVisible"] = !![]);
  }
  ["_updateTile"](b2) {
    const c2 = b2["content"];
    for (let d2 = 0; d2 < c2["featuresLength"]; d2++) {
      const e2 = c2["getFeature"](d2);
      if (this["_propertiesCache"]) {
        const f2 = e2["getProperty"](this["_primaryKey"]);
        f2 && this["setFeatureProperties"](e2, this["_propertiesCache"][f2]);
      }
      if (this["_styleCallback"]) {
        const g2 = this["getFeatureProperties"](e2), h2 = this["_styleCallback"]({ "feature": e2, "properties": g2 });
        h2 && (e2["color"] = getCesiumColor(h2));
      }
    }
    this["emit"](EventType["update"]);
  }
  ["_mergePostion"](b2) {
    b2 && (!this["_center"] && (this["_center"] = new LatLngPoint()), a$b["defined"](b2["lat"]) && (this["_center"]["lat"] = b2["lat"]), a$b["defined"](b2["lng"]) && (this["_center"]["lng"] = b2["lng"]), a$b["defined"](b2["alt"]) && (this["_center"]["alt"] = b2["alt"]));
  }
  ["_initHighlight"]() {
    var _a;
    if (this["highlight"]) return;
    this["highlight"] = new HighlightTileset({ "viewer": this["_earth"]["viewer"], "tileset": this["_tileset"], "schema": { ...this["options"]["highlight"], "id": this["id"] }, "mergeSchema": !![] });
    const b2 = ((_a = this["options"]["highlight"]) == null ? void 0 : _a["trigger"]) ?? "click";
    this["on"](EventType["click"], (c2) => {
      var _a2, _b, _c, _d, _e, _f, _g, _h;
      if (b2 == "click") {
        if ((_a2 = this["options"]["highlight"]) == null ? void 0 : _a2["filter"]) {
          if (!((_c = (_b = this["options"]["highlight"]) == null ? void 0 : _b["filter"]) == null ? void 0 : _c.call(_b, c2["data"]))) return;
        }
        if (c2["sourceTarget"] instanceof a$b["Cesium3DTileFeature"]) {
          if (this["_tileset"] && ((_d = this["options"]["highlight"]) == null ? void 0 : _d["all"])) {
            const d2 = getCesiumColor((_e = this["options"]["highlight"]) == null ? void 0 : _e["selectedColor"])["toCssColorString"]();
            this["_tileset"]["style"] = new a$b["Cesium3DTileStyle"]({ "color": { "conditions": [["true", d2]] } }), this["_highlightAll"] = !![];
            return;
          }
          (_g = this["highlight"]) == null ? void 0 : _g["openHighlight"](c2["sourceTarget"], this["id"], !((_f = this["options"]["highlight"]) == null ? void 0 : _f["multi"]));
        } else {
          if (this["_tileset"] && this["_highlightAll"]) {
            this["_highlightAll"] = ![], this["_tileset"]["style"] = this["_styleCache"];
            return;
          }
          (_h = this["highlight"]) == null ? void 0 : _h["clearHighlight"](this["id"]);
        }
      }
    }), this["on"](EventType["mouseOver"], (c2) => {
      var _a2, _b, _c, _d, _e, _f, _g;
      if (b2 == "hover") {
        if ((_a2 = this["options"]["highlight"]) == null ? void 0 : _a2["filter"]) {
          if (!((_c = (_b = this["options"]["highlight"]) == null ? void 0 : _b["filter"]) == null ? void 0 : _c.call(_b, c2["data"]))) return;
        }
        if (c2["sourceTarget"] instanceof a$b["Cesium3DTileFeature"]) {
          if (this["_tileset"] && ((_d = this["options"]["highlight"]) == null ? void 0 : _d["all"])) {
            const d2 = getCesiumColor((_e = this["options"]["highlight"]) == null ? void 0 : _e["selectedColor"])["toCssColorString"]();
            this["_tileset"]["style"] = new a$b["Cesium3DTileStyle"]({ "color": { "conditions": [["true", d2]] } }), this["_highlightAll"] = !![];
            return;
          }
          (_g = this["highlight"]) == null ? void 0 : _g["openHighlight"](c2["sourceTarget"], this["id"], !((_f = this["options"]["highlight"]) == null ? void 0 : _f["multi"]));
        }
      }
    }), this["on"](EventType["mouseOut"], (c2) => {
      var _a2, _b;
      if (b2 == "hover") {
        if (this["_tileset"] && this["_highlightAll"]) {
          this["_highlightAll"] = ![], this["_tileset"]["style"] = this["_styleCache"];
          return;
        }
        !((_a2 = this["options"]["highlight"]) == null ? void 0 : _a2["multi"]) && ((_b = this["highlight"]) == null ? void 0 : _b["clearHighlight"](this["id"]));
      }
    });
  }
  ["_destroyHighlight"]() {
    var _a;
    (_a = this["highlight"]) == null ? void 0 : _a["destroy"](), this["highlight"] = void 0;
  }
  ["_init"]() {
    var _a, _b, _c, _d;
    this["_originCenterPosition"] = a$b["clone"]((_a = this["_tileset"]) == null ? void 0 : _a["boundingSphere"]["center"]);
    if (this["hasTransform"]) {
      if (this["_tileset"]) {
        const b2 = this["_tileset"]["root"]["transform"] instanceof a$b["Matrix4"] ? this["_tileset"]["root"]["transform"] : a$b["Matrix4"]["fromArray"](this["_tileset"]["root"]["transform"]);
        this["_originMatrix"] = a$b["Matrix4"]["inverse"](b2, new a$b["Matrix4"]());
        const c2 = a$b["Matrix4"]["getTranslation"](b2, new a$b["Cartesian3"]());
        if (a$b["defined"](c2) && a$b["Cartographic"]["fromCartesian"](c2)) {
          this["_originCenterPosition"] = c2;
          const d2 = a$b["Matrix4"]["getMatrix3"](b2, new a$b["Matrix3"]()), e2 = a$b["Matrix4"]["getMatrix3"](a$b["Transforms"]["eastNorthUpToFixedFrame"](c2), new a$b["Matrix3"]()), f2 = a$b["Matrix3"]["getColumn"](e2, 0, new a$b["Cartesian3"]()), g2 = a$b["Matrix3"]["getColumn"](e2, 1, new a$b["Cartesian3"]()), h2 = a$b["Matrix3"]["getColumn"](e2, 2, new a$b["Cartesian3"]());
          let i2 = a$b["Matrix3"]["getColumn"](d2, 0, new a$b["Cartesian3"]());
          i2 = a$b["Cartesian3"]["cross"](i2, h2, i2), i2 = a$b["Cartesian3"]["cross"](h2, i2, i2), i2 = a$b["Cartesian3"]["normalize"](i2, i2);
          let j2 = a$b["Cartesian3"]["angleBetween"](f2, i2);
          const k2 = a$b["Cartesian3"]["angleBetween"](g2, i2);
          k2 > Math["PI"] * 0.5 && (j2 = 2 * Math["PI"] - j2), this["_originRotation"] = { "x": 0, "y": 0, "z": Number(a$b["Math"]["toDegrees"](j2)["toFixed"](1)) };
        }
      }
    }
    this["_originCenterPoint"] = LatLngPoint["fromCartesian"](this["_originCenterPosition"]), handlerInfo(this["name"] + " 模型中心位置:" + this["_originCenterPoint"]["toString"]());
    a$b["defined"](this["options"]["style"]) && (this["style"] = this["options"]["style"]);
    this["_styleCache"] = (_b = this["tileset"]) == null ? void 0 : _b["style"];
    this["_opacity"] != 1 && this["setOpacity"](this["_opacity"]);
    this["_center"] = this["_originCenterPoint"]["clone"]();
    this["options"]["position"] && this["_mergePostion"](this["options"]["position"]);
    if (this["options"]["chinaCRS"]) {
      const l2 = this["_transformCenter"](this["center"]);
      l2 && this["_mergePostion"](l2);
    }
    this["_hasUpdateMater"]() && this["updateMatrix"](), this["options"]["clampToGround"] && this["clampToGround"](), this["options"]["flyTo"] && (a$b["defined"]((_c = this["options"]["homeVision"]) == null ? void 0 : _c["pitch"]) ? this["flyTo"]() : this["flyTo"]({ "minPitch": -45, "maxPitch": 45 })), !((_d = this["options"]["highlight"]) == null ? void 0 : _d["disable"]) && this["_initHighlight"](), this["emit"](EventType["load"], { "tileset": this["_tileset"] });
  }
  ["_transformCenter"](b2) {
    const c2 = this["_earth"]["_chinaCRS"], d2 = this["options"]["chinaCRS"];
    if (c2 && d2 && c2 != d2) {
      const e2 = getTransFun(d2, c2);
      if (!e2) return void 0;
      const f2 = e2([b2["lng"], b2["lat"]]);
      return { "lng": f2[0], "lat": f2[1], "alt": b2["alt"] };
    } else return { "lng": b2["lng"], "lat": b2["lat"], "alt": b2["alt"] };
  }
  ["_hasUpdateMater"]() {
    if (!this["center"]["equals"](this["_originCenterPoint"])) return !![];
    if (this["options"]["rotation"]) return !![];
    if (a$b["defined"](this["options"]["scale"]) && this["options"]["scale"] > 0 && this["options"]["scale"] != 1) return !![];
    if (a$b["defined"](this["options"]["axis"])) return !![];
    return ![];
  }
  ["_updateMatrix2"]() {
    if (!this["_tileset"] || !this["_tileset"]["root"]) return;
    const b2 = a$b["Cartographic"]["fromCartesian"](this["_tileset"]["boundingSphere"]["center"]), c2 = a$b["Cartesian3"]["fromRadians"](b2["longitude"], b2["latitude"], 0), d2 = this["position"], e2 = a$b["Cartesian3"]["subtract"](d2, c2, new a$b["Cartesian3"]()), f2 = a$b["Matrix4"]["fromTranslation"](e2);
    return this["_tileset"]["modelMatrix"] = f2, f2;
  }
  ["setOpacity"](b2) {
    this["_opacity"] = b2, this["_tileset"] && (this["_tileset"]["style"] = new a$b["Cesium3DTileStyle"]({ "color": "color() * vec4(1.0 ,1.0 ,1.0, " + b2 + ")" }));
  }
  ["setCenter"](b2) {
    this["_center"] = LatLngPoint["parse"](b2), this["updateMatrix"]();
  }
  ["setHeight"](b2) {
    if (!this["_tileset"]) return;
    this["_center"]["alt"] = b2, this["updateMatrix"]();
  }
  ["setRotation"](b2) {
    this["options"]["rotation"] = b2, this["updateMatrix"]();
  }
  ["setRotationX"](b2) {
    this["options"]["rotation"] = this["options"]["rotation"] || { "x": 0, "y": 0, "z": 0 }, this["options"]["rotation"]["x"] = b2, this["updateMatrix"]();
  }
  ["setRotationY"](b2) {
    this["options"]["rotation"] = this["options"]["rotation"] || { "x": 0, "y": 0, "z": 0 }, this["options"]["rotation"]["y"] = b2, this["updateMatrix"]();
  }
  ["setRrotationZ"](b2) {
    this["options"]["rotation"] = this["options"]["rotation"] || { "x": 0, "y": 0, "z": 0 }, this["options"]["rotation"]["z"] = b2, this["updateMatrix"]();
  }
  ["setAxis"](b2) {
    this["options"]["axis"] = b2, this["updateMatrix"]();
  }
  ["setScale"](b2) {
    this["options"]["scale"] = b2, this["updateMatrix"]();
  }
  ["setStyle"](b2) {
    this["options"]["style"] = b2, this["_styleCallback"] = void 0;
    if (this["_tileset"]) {
      if (b2 instanceof a$b["Cesium3DTileStyle"]) this["_tileset"]["style"] = b2;
      else typeof b2 == "function" ? (this["_styleCallback"] = b2, this["_bindTileVisibleEvent"]()) : this["_tileset"]["style"] = new a$b["Cesium3DTileStyle"](b2);
      this["_styleCache"] = this["_tileset"]["style"];
    }
  }
  ["setCustomShader"](b2) {
    this["options"]["customShader"] = b2, this["_tileset"] && (this["_tileset"]["customShader"] = b2);
  }
  ["clampToGround"](b2 = 1) {
    this["_earth"]["hasTerrain"] ? getSurfaceTerrainHeight(this["_earth"]["viewer"], this["_originCenterPosition"], { "async": !![], "callback": (c2, d2) => {
      if (c2 == null) return;
      this["height"] = c2 - this["_originCenterPoint"]["alt"] + b2;
    } }) : this["height"] = -this["_originCenterPoint"]["alt"] + b2;
  }
  ["setProperties"](b2, c2 = "id") {
    this["_primaryKey"] = c2, this["_propertiesCache"] = {}, b2["forEach"]((d2) => {
      const e2 = d2[c2];
      this["_propertiesCache"][e2] = d2;
    }), this["_bindTileVisibleEvent"]();
  }
  ["getFeatureProperties"](b2) {
    const c2 = {}, d2 = b2["getPropertyIds"]();
    for (let e2 = 0; e2 < d2["length"]; e2++) {
      const f2 = d2[e2];
      if (!b2["hasProperty"](f2)) continue;
      const g2 = b2["getProperty"](f2);
      if (g2 == null) continue;
      c2[f2] = g2;
    }
    return c2;
  }
  ["setFeatureProperties"](b2, c2) {
    if (!b2 || !c2) return;
    for (const d2 in c2) {
      const e2 = c2[d2];
      if (b2["hasProperty"](d2) && b2["getProperty"](d2) === e2) continue;
      b2["setProperty"](d2, e2);
    }
  }
  ["updateMatrix"]() {
    if (!this["_tileset"]) return void 0;
    if (!this["hasTransform"]) return this["_updateMatrix2"]();
    let b2 = a$b["Transforms"]["eastNorthUpToFixedFrame"](this["position"]);
    if (this["options"]["rotation"]) {
      const c2 = a$b["Matrix3"]["fromRotationX"](a$b["Math"]["toRadians"](this["rotation_x"])), d2 = a$b["Matrix3"]["fromRotationY"](a$b["Math"]["toRadians"](this["rotation_y"])), e2 = a$b["Matrix3"]["fromRotationZ"](a$b["Math"]["toRadians"](360 - this["rotation_z"])), f2 = a$b["Matrix4"]["fromRotationTranslation"](c2), g2 = a$b["Matrix4"]["fromRotationTranslation"](d2), h2 = a$b["Matrix4"]["fromRotationTranslation"](e2);
      a$b["Matrix4"]["multiply"](b2, f2, b2), a$b["Matrix4"]["multiply"](b2, g2, b2), a$b["Matrix4"]["multiply"](b2, h2, b2);
    }
    a$b["defined"](this["options"]["scale"]) && this["options"]["scale"] > 0 && this["options"]["scale"] != 1 && a$b["Matrix4"]["multiplyByUniformScale"](b2, this["options"]["scale"], b2);
    if (a$b["defined"](this["options"]["axis"])) {
      let i2;
      isString(this["options"]["axis"]) && (i2 = a$b["Axis"]["fromName"](this["options"]["axis"]["toUpperCase"]())), i2 && (b2 = a$b["Matrix4"]["multiplyTransformation"](b2, i2, b2));
    }
    return this["_tileset"]["root"]["transform"] = b2, b2;
  }
  ["optimize"](b2 = this["defaultTilesetOptimizeOptions"], c2 = !![]) {
    if (c2) for (const d2 in this["defaultTilesetOptimizeOptions"]) {
      b2[d2] ?? (b2[d2] = this["defaultTilesetOptimizeOptions"][d2]);
    }
    if (this["_tileset"]) for (const e2 in b2) {
      this["_tileset"][e2] = b2[e2];
    }
  }
  ["createCustomShader"](b2, c2) {
    let d2;
    switch (b2) {
      case CustomShaderType["DistanceColorChange"]:
        const e2 = c2, f2 = (e2 == null ? void 0 : e2["changedRgbIndex"]) ?? "g", g2 = (e2 == null ? void 0 : e2["far"]) ?? 1e4, h2 = getCesiumColor(e2 == null ? void 0 : e2["baseColor"], a$b["Color"]["BLUE"]);
        d2 = new a$b["CustomShader"]({ "uniforms": { "u_baseColor": { "type": a$b["UniformType"]["VEC3"], "value": h2 }, "u_far": { "type": a$b["UniformType"]["FLOAT"], "value": g2 }, "u_changedR": { "type": a$b["UniformType"]["BOOL"], "value": f2 == "r" }, "u_changedG": { "type": a$b["UniformType"]["BOOL"], "value": f2 == "g" }, "u_changedB": { "type": a$b["UniformType"]["BOOL"], "value": f2 == "b" } }, "lightingModel": a$b["LightingModel"]["UNLIT"], "fragmentShaderText": "\n            void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {\n              // 初始纯蓝色\n              material.diffuse = u_baseColor;\n              // rgb  r:代表red的色值，从fsInput.attributes.positionEC.z（很可能是眼坐标（Eye Coordinates）下的顶点Z位置）中获取一个值，并将其除以1.0e4（即10,000），然后取反，赋值给material.diffuse.g\n              if(u_changedR){\n                material.diffuse.r = -fsInput.attributes.positionEC.z / u_far;\n              }\n              if(u_changedG){\n                material.diffuse.g = -fsInput.attributes.positionEC.z / u_far;\n              }\n              if(u_changedB){\n                material.diffuse.b = -fsInput.attributes.positionEC.z / u_far;\n              }\n            } " });
        break;
      case CustomShaderType["DynamicHalo"]:
        const i2 = c2;
        (i2 == null ? void 0 : i2["onClick"]) && this["on"](EventType["click"], (r2) => {
          var _a;
          (_a = i2 == null ? void 0 : i2["onClick"]) == null ? void 0 : _a.call(i2, this, r2);
        });
        const j2 = getCesiumColor(i2 == null ? void 0 : i2["baseColorBottom"], a$b["Color"]["BLACK"]), k2 = getCesiumColor(i2 == null ? void 0 : i2["baseColorTop"], a$b["Color"]["INDIGO"]), l2 = getCesiumColor(i2 == null ? void 0 : i2["lightColor"], a$b["Color"]["fromCssColorString"]("#ff00ff")), m2 = (i2 == null ? void 0 : i2["baseHeight"]) ?? 0, n2 = (i2 == null ? void 0 : i2["heightRange"]) ?? 400, o2 = (i2 == null ? void 0 : i2["glowRange"]) ?? 400, p2 = (i2 == null ? void 0 : i2["lightRadius"]) ?? 1e3, q2 = LatLngPoint["parse"]((i2 == null ? void 0 : i2["lightPosition"]) ?? [0, 0, 0])["toCartesian"]();
        d2 = new a$b["CustomShader"]({ "uniforms": { "u_baseColorBottom": { "type": a$b["UniformType"]["VEC3"], "value": j2 }, "u_baseColorTop": { "type": a$b["UniformType"]["VEC3"], "value": k2 }, "u_baseHeight": { "type": a$b["UniformType"]["FLOAT"], "value": m2 }, "u_heightRange": { "type": a$b["UniformType"]["FLOAT"], "value": n2 }, "u_glowRange": { "type": a$b["UniformType"]["FLOAT"], "value": o2 }, "u_lightPosition": { "type": a$b["UniformType"]["VEC3"], "value": q2 }, "u_lightColor": { "type": a$b["UniformType"]["VEC3"], "value": l2 }, "u_lightRadius": { "type": a$b["UniformType"]["FLOAT"], "value": p2 } }, "lightingModel": a$b["LightingModel"]["UNLIT"], "mode": a$b["CustomShaderMode"]["REPLACE_MATERIAL"], "fragmentShaderText": "\n            #define sat( a ) clamp( a, 0.0, 1.0 )\n            float getDistanceDecay( float lightDistance, float distance,float decay) {\n              if ( distance > 0.0 && decay > 0.0 ) {\n                  return pow( sat( - lightDistance / distance + 1.0 ), decay );\n              }\n              return 1.0;\n            }\n            vec3 addPointLight(vec3 lightPosition, vec3 lightColor, vec3 positionWC , vec3 normal){\n              float distance = u_lightRadius;\n              float decay = 1.0;\n              float lightDistance = length( lightPosition - positionWC );\n              lightColor *= getDistanceDecay( lightDistance, distance, decay );\n              return lightColor;\n            }\n\n            void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)\n            {\n              vec3 positionMC = fsInput.attributes.positionMC;\n              vec3 normalEC = fsInput.attributes.normalEC;\n              float jzw_height = positionMC.z - u_baseHeight;\n              vec3 glColor = vec3(0.);\n\n              // 渐变\n              glColor.rgb = mix(u_baseColorBottom, u_baseColorTop,clamp(positionMC.z / u_heightRange, 0.0, 1.0)) ;\n              float diffuseCoefficient = max(0.0, dot(normalEC, vec3(0.5)) * 1.0);\n              glColor.rgb *= min(diffuseCoefficient + 0.1, 1.0);\n\n              // 光圈特效\n              float time = fract(czm_frameNumber / 360.0);\n              time = abs(time - 0.5) * 2.0;\n              float jzw_h = clamp(jzw_height / u_glowRange, 0.0, 1.0);\n              float jzw_diff = step(0.005, abs(jzw_h - time));\n              glColor.rgb += glColor.rgb * (1.0 - jzw_diff);\n\n              // 点光源\n              glColor.rgb += addPointLight(\n                u_lightPosition ,\n                u_lightColor,\n                (czm_model * vec4(positionMC,1.0)).xyz,\n                normalEC);\n\n              material.diffuse = mix(glColor.rgb, material.diffuse, 0.0);\n            } " });
        break;
      default:
        d2 = void 0;
        break;
    }
    return d2;
  }
  ["getRectangle"](b2) {
    if (this["boundingSphere"]) {
      const c2 = a$b["Rectangle"]["fromBoundingSphere"](this["boundingSphere"]);
      return b2 ? formatRectangle(c2) : c2;
    } else return void 0;
  }
}
__publicField(TilesetLayer, "EventType", { ...BaseLayer["EventType"], ...pick(EventType, ["click", "rightClick", "mouseOver", "mouseOut", "initialTilesLoaded", "allTilesLoaded", "load", "update"]) });
const LayerType = { "terrain": TerrainLayer, "wms": WmsLayer, "wmts": WmtsLayer, "image": ImageLayer, "xyz": XyzLayer, "tileset": TilesetLayer, "group": GroupLayer, "colorPatternGrid": ColorPatternGridLayer, "colorPatternGradient": ColorPatternGradientLayer };
const LifeCycleState = { "INITED": "inited", "ADDED": "added", "REMOVED": "removed", "DESTROYED": "destroyed" };
const MaterialType = { "Color": a$b["Material"]["ColorType"], "Image": a$b["Material"]["ImageType"], "Grid": a$b["Material"]["GridType"], "Checkerboard": a$b["Material"]["CheckerboardType"], "Stripe": a$b["Material"]["StripeType"], "Image2": "Image2", "Water": a$b["Material"]["WaterType"], "PolylineDash": a$b["Material"]["PolylineDashType"], "PolylineOutline": a$b["Material"]["PolylineOutlineType"], "PolylineArrow": a$b["Material"]["PolylineArrowType"], "PolylineGlow": a$b["Material"]["PolylineGlowType"], "LineFlow": "LineFlow", "LineFlowColor": "LineFlowColor", "ODLine": "ODLine", "LineFlicker": "LineFlicker", "LineTrail": "LineTrail", "WallScroll": "WallScroll", "ScanLine": "ScanLine", "CircleScan": "CircleScan", "CircleWave": "CircleWave", "RadarLine": "RadarLine", "RadarWave": "RadarWave", "Text": "Text", "RectSlide": "RectSlide", "PolyGradient": "PolyGradient", "PolyAsphalt": "PolyAsphalt", "PolyBlob": "PolyBlob", "PolyFacet": "PolyFacet", "PolyGrass": "PolyGrass", "PolyWood": "PolyWood", "EllipsoidElectric": "EllipsoidElectric", "EllipsoidWave": "EllipsoidWave", "CylinderWave": "CylinderWave", "ColorPatternGradient": "ColorPatternGradient" };
const MoveType = { "ENLARGE": 0, "NARROW": 1, "LEFT_ROTATE": 2, "RIGHT_ROTATE": 3, "TOP_ROTATE": 4, "BOTTOM_ROTATE": 5 };
const TerrainType = { "ELLIPSOID": "ellipsoid", "XYZ": "xyz", "ION": "ion", "VR": "vr", "ARCGIS": "arcgis" };
const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CRS,
  ChinaCRS,
  ClipType,
  CustomShaderType,
  EventType,
  LayerType,
  LifeCycleState,
  MaterialType,
  MoveType,
  State,
  TerrainType
}, Symbol.toStringTag, { value: "Module" }));
class LatLngArray {
  static ["toCartesians"](b2, c2) {
    if (!Array["isArray"](b2)) return b2;
    const d2 = [];
    return b2["forEach"]((e2) => {
      if (e2 instanceof a$b["Cartesian3"] && !c2) {
        d2["push"](e2);
        return;
      }
      const f2 = LatLngPoint["parse"](e2);
      if (!f2 || !f2["valid"]()) return;
      d2["push"](f2["toCartesian"]());
    }), d2;
  }
  static ["toPoints"](b2) {
    if (!Array["isArray"](b2)) return b2;
    const c2 = [];
    return b2["forEach"]((d2) => {
      if (d2 instanceof LatLngPoint) {
        c2["push"](d2);
        return;
      }
      const e2 = LatLngPoint["parse"](d2);
      if (!e2 || !e2["valid"]()) return;
      c2["push"](e2);
    }), c2;
  }
  static ["toArray"](b2, c2) {
    if (!Array["isArray"](b2)) return b2;
    const d2 = [];
    return b2["forEach"]((e2) => {
      if (Array["isArray"](e2)) {
        d2["push"](e2);
        return;
      }
      const f2 = LatLngPoint["parse"](e2);
      if (!f2 || !f2["valid"]()) return;
      d2["push"](f2["toArray"](c2));
    }), d2;
  }
}
function a$9(defs2) {
  defs2("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), defs2("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), defs2("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"), defs2["WGS84"] = defs2["EPSG:4326"], defs2["EPSG:3785"] = defs2["EPSG:3857"], defs2["GOOGLE"] = defs2["EPSG:3857"], defs2["EPSG:900913"] = defs2["EPSG:3857"], defs2["EPSG:102113"] = defs2["EPSG:3857"];
}
var PJD_3PARAM = 1;
var PJD_7PARAM = 2;
var PJD_GRIDSHIFT = 3;
var PJD_WGS84 = 4;
var PJD_NODATUM = 5;
var SRS_WGS84_SEMIMAJOR = 6378137;
var SRS_WGS84_SEMIMINOR = 6356752314e-3;
var SRS_WGS84_ESQUARED = 0.0066943799901413165;
var SEC_TO_RAD = 484813681109536e-20;
var HALF_PI = Math["PI"] / 2;
var SIXTH = 0.16666666666666666;
var RA4 = 0.04722222222222222;
var RA6 = 0.022156084656084655;
var EPSLN = 1e-10;
var D2R$1 = 0.017453292519943295;
var R2D = 57.29577951308232;
var FORTPI = Math["PI"] / 4;
var TWO_PI = Math["PI"] * 2;
var SPI = 3.14159265359;
var exports$2 = {};
exports$2["greenwich"] = 0, exports$2["lisbon"] = -9.131906111111, exports$2["paris"] = 2.337229166667, exports$2["bogota"] = -74.080916666667, exports$2["madrid"] = -3.687938888889, exports$2["rome"] = 12.452333333333, exports$2["bern"] = 7.439583333333, exports$2["jakarta"] = 106.807719444444, exports$2["ferro"] = -17.666666666667, exports$2["brussels"] = 4.367975, exports$2["stockholm"] = 18.058277777778, exports$2["athens"] = 23.7163375, exports$2["oslo"] = 10.722916666667;
const b$e = { "ft": { "to_meter": 0.3048 }, "us-ft": { "to_meter": 1200 / 3937 } };
var ignoredChar = /[\s_\-\/\(\)]/g;
function match(a2, b2) {
  if (a2[b2]) return a2[b2];
  var c2 = Object["keys"](a2), d2 = b2["toLowerCase"]()["replace"](ignoredChar, ""), e2 = -1, f2, g2;
  while (++e2 < c2["length"]) {
    f2 = c2[e2], g2 = f2["toLowerCase"]()["replace"](ignoredChar, "");
    if (g2 === d2) return a2[f2];
  }
}
function c$4(defData) {
  var self2 = {}, paramObj = defData["split"]("+")["map"](function(v2) {
    return v2["trim"]();
  })["filter"](function(a2) {
    return a2;
  })["reduce"](function(p2, a2) {
    var split = a2["split"]("=");
    return split["push"](!![]), p2[split[0]["toLowerCase"]()] = split[1], p2;
  }, {}), paramName, paramVal, paramOutname, params2 = { "proj": "projName", "datum": "datumCode", "rf": function(v2) {
    self2["rf"] = parseFloat(v2);
  }, "lat_0": function(v2) {
    self2["lat0"] = v2 * D2R$1;
  }, "lat_1": function(v2) {
    self2["lat1"] = v2 * D2R$1;
  }, "lat_2": function(v2) {
    self2["lat2"] = v2 * D2R$1;
  }, "lat_ts": function(v2) {
    self2["lat_ts"] = v2 * D2R$1;
  }, "lon_0": function(v2) {
    self2["long0"] = v2 * D2R$1;
  }, "lon_1": function(v2) {
    self2["long1"] = v2 * D2R$1;
  }, "lon_2": function(v2) {
    self2["long2"] = v2 * D2R$1;
  }, "alpha": function(v2) {
    self2["alpha"] = parseFloat(v2) * D2R$1;
  }, "gamma": function(v2) {
    self2["rectified_grid_angle"] = parseFloat(v2);
  }, "lonc": function(v2) {
    self2["longc"] = v2 * D2R$1;
  }, "x_0": function(v2) {
    self2["x0"] = parseFloat(v2);
  }, "y_0": function(v2) {
    self2["y0"] = parseFloat(v2);
  }, "k_0": function(v2) {
    self2["k0"] = parseFloat(v2);
  }, "k": function(v2) {
    self2["k0"] = parseFloat(v2);
  }, "a": function(v2) {
    self2["a"] = parseFloat(v2);
  }, "b": function(v2) {
    self2["b"] = parseFloat(v2);
  }, "r": function(v2) {
    self2["a"] = self2["b"] = parseFloat(v2);
  }, "r_a": function() {
    self2["R_A"] = !![];
  }, "zone": function(v2) {
    self2["zone"] = parseInt(v2, 10);
  }, "south": function() {
    self2["utmSouth"] = !![];
  }, "towgs84": function(v2) {
    self2["datum_params"] = v2["split"](",")["map"](function(a2) {
      return parseFloat(a2);
    });
  }, "to_meter": function(v2) {
    self2["to_meter"] = parseFloat(v2);
  }, "units": function(v2) {
    self2["units"] = v2;
    var unit = match(b$e, v2);
    unit && (self2["to_meter"] = unit["to_meter"]);
  }, "from_greenwich": function(v2) {
    self2["from_greenwich"] = v2 * D2R$1;
  }, "pm": function(v2) {
    var pm = match(exports$2, v2);
    self2["from_greenwich"] = (pm ? pm : parseFloat(v2)) * D2R$1;
  }, "nadgrids": function(v2) {
    v2 === "@null" ? self2["datumCode"] = "none" : self2["nadgrids"] = v2;
  }, "axis": function(v2) {
    var legalAxis = "ewnsud";
    v2["length"] === 3 && legalAxis["indexOf"](v2["substr"](0, 1)) !== -1 && legalAxis["indexOf"](v2["substr"](1, 1)) !== -1 && legalAxis["indexOf"](v2["substr"](2, 1)) !== -1 && (self2["axis"] = v2);
  }, "approx": function() {
    self2["approx"] = !![];
  } };
  for (paramName in paramObj) {
    paramVal = paramObj[paramName], paramName in params2 ? (paramOutname = params2[paramName], typeof paramOutname === "function" ? paramOutname(paramVal) : self2[paramOutname] = paramVal) : self2[paramName] = paramVal;
  }
  return typeof self2["datumCode"] === "string" && self2["datumCode"] !== "WGS84" && (self2["datumCode"] = self2["datumCode"]["toLowerCase"]()), self2;
}
var NEUTRAL = 1, KEYWORD = 2, NUMBER = 3, QUOTED = 4, AFTERQUOTE = 5, ENDED = -1, whitespace = /\s/, latin = /[A-Za-z]/, keyword = /[A-Za-z84_]/, endThings = /[,\]]/, digets = /[\d\.E\-\+]/;
function Parser(a2) {
  if (typeof a2 !== "string") throw new Error("not a string");
  this["text"] = a2["trim"](), this["level"] = 0, this["place"] = 0, this["root"] = null, this["stack"] = [], this["currentObject"] = null, this["state"] = NEUTRAL;
}
Parser["prototype"]["readCharicter"] = function() {
  var a2 = this["text"][this["place"]++];
  if (this["state"] !== QUOTED) while (whitespace["test"](a2)) {
    if (this["place"] >= this["text"]["length"]) return;
    a2 = this["text"][this["place"]++];
  }
  switch (this["state"]) {
    case NEUTRAL:
      return this["neutral"](a2);
    case KEYWORD:
      return this["keyword"](a2);
    case QUOTED:
      return this["quoted"](a2);
    case AFTERQUOTE:
      return this["afterquote"](a2);
    case NUMBER:
      return this["number"](a2);
    case ENDED:
      return;
  }
}, Parser["prototype"]["afterquote"] = function(a2) {
  if (a2 === '"') {
    this["word"] += '"', this["state"] = QUOTED;
    return;
  }
  if (endThings["test"](a2)) {
    this["word"] = this["word"]["trim"](), this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in afterquote yet, index ' + this["place"]);
}, Parser["prototype"]["afterItem"] = function(a2) {
  if (a2 === ",") {
    this["word"] !== null && this["currentObject"]["push"](this["word"]);
    this["word"] = null, this["state"] = NEUTRAL;
    return;
  }
  if (a2 === "]") {
    this["level"]--;
    this["word"] !== null && (this["currentObject"]["push"](this["word"]), this["word"] = null);
    this["state"] = NEUTRAL, this["currentObject"] = this["stack"]["pop"]();
    !this["currentObject"] && (this["state"] = ENDED);
    return;
  }
}, Parser["prototype"]["number"] = function(a2) {
  if (digets["test"](a2)) {
    this["word"] += a2;
    return;
  }
  if (endThings["test"](a2)) {
    this["word"] = parseFloat(this["word"]), this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in number yet, index ' + this["place"]);
}, Parser["prototype"]["quoted"] = function(a2) {
  if (a2 === '"') {
    this["state"] = AFTERQUOTE;
    return;
  }
  this["word"] += a2;
  return;
}, Parser["prototype"]["keyword"] = function(a2) {
  if (keyword["test"](a2)) {
    this["word"] += a2;
    return;
  }
  if (a2 === "[") {
    var b2 = [];
    b2["push"](this["word"]), this["level"]++;
    this["root"] === null ? this["root"] = b2 : this["currentObject"]["push"](b2);
    this["stack"]["push"](this["currentObject"]), this["currentObject"] = b2, this["state"] = NEUTRAL;
    return;
  }
  if (endThings["test"](a2)) {
    this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in keyword yet, index ' + this["place"]);
}, Parser["prototype"]["neutral"] = function(a2) {
  if (latin["test"](a2)) {
    this["word"] = a2, this["state"] = KEYWORD;
    return;
  }
  if (a2 === '"') {
    this["word"] = "", this["state"] = QUOTED;
    return;
  }
  if (digets["test"](a2)) {
    this["word"] = a2, this["state"] = NUMBER;
    return;
  }
  if (endThings["test"](a2)) {
    this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in neutral yet, index ' + this["place"]);
}, Parser["prototype"]["output"] = function() {
  while (this["place"] < this["text"]["length"]) {
    this["readCharicter"]();
  }
  if (this["state"] === ENDED) return this["root"];
  throw new Error('unable to parse string "' + this["text"] + '". State is ' + this["state"]);
};
function parseString(a2) {
  var b2 = new Parser(a2);
  return b2["output"]();
}
function mapit(a2, b2, c2) {
  Array["isArray"](b2) && (c2["unshift"](b2), b2 = null);
  var d2 = b2 ? {} : a2, e2 = c2["reduce"](function(f2, g2) {
    return sExpr(g2, f2), f2;
  }, d2);
  b2 && (a2[b2] = e2);
}
function sExpr(a2, b2) {
  if (!Array["isArray"](a2)) {
    b2[a2] = !![];
    return;
  }
  var c2 = a2["shift"]();
  c2 === "PARAMETER" && (c2 = a2["shift"]());
  if (a2["length"] === 1) {
    if (Array["isArray"](a2[0])) {
      b2[c2] = {}, sExpr(a2[0], b2[c2]);
      return;
    }
    b2[c2] = a2[0];
    return;
  }
  if (!a2["length"]) {
    b2[c2] = !![];
    return;
  }
  if (c2 === "TOWGS84") {
    b2[c2] = a2;
    return;
  }
  if (c2 === "AXIS") {
    !(c2 in b2) && (b2[c2] = []);
    b2[c2]["push"](a2);
    return;
  }
  !Array["isArray"](c2) && (b2[c2] = {});
  var d2;
  switch (c2) {
    case "UNIT":
    case "PRIMEM":
    case "VERT_DATUM":
      b2[c2] = { "name": a2[0]["toLowerCase"](), "convert": a2[1] };
      a2["length"] === 3 && sExpr(a2[2], b2[c2]);
      return;
    case "SPHEROID":
    case "ELLIPSOID":
      b2[c2] = { "name": a2[0], "a": a2[1], "rf": a2[2] };
      a2["length"] === 4 && sExpr(a2[3], b2[c2]);
      return;
    case "PROJECTEDCRS":
    case "PROJCRS":
    case "GEOGCS":
    case "GEOCCS":
    case "PROJCS":
    case "LOCAL_CS":
    case "GEODCRS":
    case "GEODETICCRS":
    case "GEODETICDATUM":
    case "EDATUM":
    case "ENGINEERINGDATUM":
    case "VERT_CS":
    case "VERTCRS":
    case "VERTICALCRS":
    case "COMPD_CS":
    case "COMPOUNDCRS":
    case "ENGINEERINGCRS":
    case "ENGCRS":
    case "FITTED_CS":
    case "LOCAL_DATUM":
    case "DATUM":
      a2[0] = ["name", a2[0]], mapit(b2, c2, a2);
      return;
    default:
      d2 = -1;
      while (++d2 < a2["length"]) {
        if (!Array["isArray"](a2[d2])) return sExpr(a2, b2[c2]);
      }
      return mapit(b2, c2, a2);
  }
}
var D2R = 0.017453292519943295;
function rename(b2, c2) {
  var d2 = c2[0], e2 = c2[1];
  !(d2 in b2) && e2 in b2 && (b2[d2] = b2[e2], c2["length"] === 3 && (b2[d2] = c2[2](b2[d2])));
}
function d2r(b2) {
  return b2 * D2R;
}
function cleanWKT(b2) {
  if (b2["type"] === "GEOGCS") b2["projName"] = "longlat";
  else b2["type"] === "LOCAL_CS" ? (b2["projName"] = "identity", b2["local"] = !![]) : typeof b2["PROJECTION"] === "object" ? b2["projName"] = Object["keys"](b2["PROJECTION"])[0] : b2["projName"] = b2["PROJECTION"];
  if (b2["AXIS"]) {
    var c2 = "";
    for (var d2 = 0, e2 = b2["AXIS"]["length"]; d2 < e2; ++d2) {
      var f2 = [b2["AXIS"][d2][0]["toLowerCase"](), b2["AXIS"][d2][1]["toLowerCase"]()];
      if (f2[0]["indexOf"]("north") !== -1 || (f2[0] === "y" || f2[0] === "lat") && f2[1] === "north") c2 += "n";
      else {
        if (f2[0]["indexOf"]("south") !== -1 || (f2[0] === "y" || f2[0] === "lat") && f2[1] === "south") c2 += "s";
        else {
          if (f2[0]["indexOf"]("east") !== -1 || (f2[0] === "x" || f2[0] === "lon") && f2[1] === "east") c2 += "e";
          else (f2[0]["indexOf"]("west") !== -1 || (f2[0] === "x" || f2[0] === "lon") && f2[1] === "west") && (c2 += "w");
        }
      }
    }
    c2["length"] === 2 && (c2 += "u"), c2["length"] === 3 && (b2["axis"] = c2);
  }
  b2["UNIT"] && (b2["units"] = b2["UNIT"]["name"]["toLowerCase"](), b2["units"] === "metre" && (b2["units"] = "meter"), b2["UNIT"]["convert"] && (b2["type"] === "GEOGCS" ? b2["DATUM"] && b2["DATUM"]["SPHEROID"] && (b2["to_meter"] = b2["UNIT"]["convert"] * b2["DATUM"]["SPHEROID"]["a"]) : b2["to_meter"] = b2["UNIT"]["convert"]));
  var g2 = b2["GEOGCS"];
  b2["type"] === "GEOGCS" && (g2 = b2);
  g2 && (g2["DATUM"] ? b2["datumCode"] = g2["DATUM"]["name"]["toLowerCase"]() : b2["datumCode"] = g2["name"]["toLowerCase"](), b2["datumCode"]["slice"](0, 2) === "d_" && (b2["datumCode"] = b2["datumCode"]["slice"](2)), (b2["datumCode"] === "new_zealand_geodetic_datum_1949" || b2["datumCode"] === "new_zealand_1949") && (b2["datumCode"] = "nzgd49"), (b2["datumCode"] === "wgs_1984" || b2["datumCode"] === "world_geodetic_system_1984") && (b2["PROJECTION"] === "Mercator_Auxiliary_Sphere" && (b2["sphere"] = !![]), b2["datumCode"] = "wgs84"), b2["datumCode"]["slice"](-6) === "_ferro" && (b2["datumCode"] = b2["datumCode"]["slice"](0, -6)), b2["datumCode"]["slice"](-8) === "_jakarta" && (b2["datumCode"] = b2["datumCode"]["slice"](0, -8)), ~b2["datumCode"]["indexOf"]("belge") && (b2["datumCode"] = "rnb72"), g2["DATUM"] && g2["DATUM"]["SPHEROID"] && (b2["ellps"] = g2["DATUM"]["SPHEROID"]["name"]["replace"]("_19", "")["replace"](/[Cc]larke\_18/, "clrk"), b2["ellps"]["toLowerCase"]()["slice"](0, 13) === "international" && (b2["ellps"] = "intl"), b2["a"] = g2["DATUM"]["SPHEROID"]["a"], b2["rf"] = parseFloat(g2["DATUM"]["SPHEROID"]["rf"], 10)), g2["DATUM"] && g2["DATUM"]["TOWGS84"] && (b2["datum_params"] = g2["DATUM"]["TOWGS84"]), ~b2["datumCode"]["indexOf"]("osgb_1936") && (b2["datumCode"] = "osgb36"), ~b2["datumCode"]["indexOf"]("osni_1952") && (b2["datumCode"] = "osni52"), (~b2["datumCode"]["indexOf"]("tm65") || ~b2["datumCode"]["indexOf"]("geodetic_datum_of_1965")) && (b2["datumCode"] = "ire65"), b2["datumCode"] === "ch1903+" && (b2["datumCode"] = "ch1903"), ~b2["datumCode"]["indexOf"]("israel") && (b2["datumCode"] = "isr93"));
  b2["b"] && !isFinite(b2["b"]) && (b2["b"] = b2["a"]);
  function h2(l2) {
    var m2 = b2["to_meter"] || 1;
    return l2 * m2;
  }
  var j2 = function(l2) {
    return rename(b2, l2);
  }, k2 = [["standard_parallel_1", "Standard_Parallel_1"], ["standard_parallel_1", "Latitude of 1st standard parallel"], ["standard_parallel_2", "Standard_Parallel_2"], ["standard_parallel_2", "Latitude of 2nd standard parallel"], ["false_easting", "False_Easting"], ["false_easting", "False easting"], ["false-easting", "Easting at false origin"], ["false_northing", "False_Northing"], ["false_northing", "False northing"], ["false_northing", "Northing at false origin"], ["central_meridian", "Central_Meridian"], ["central_meridian", "Longitude of natural origin"], ["central_meridian", "Longitude of false origin"], ["latitude_of_origin", "Latitude_Of_Origin"], ["latitude_of_origin", "Central_Parallel"], ["latitude_of_origin", "Latitude of natural origin"], ["latitude_of_origin", "Latitude of false origin"], ["scale_factor", "Scale_Factor"], ["k0", "scale_factor"], ["latitude_of_center", "Latitude_Of_Center"], ["latitude_of_center", "Latitude_of_center"], ["lat0", "latitude_of_center", d2r], ["longitude_of_center", "Longitude_Of_Center"], ["longitude_of_center", "Longitude_of_center"], ["longc", "longitude_of_center", d2r], ["x0", "false_easting", h2], ["y0", "false_northing", h2], ["long0", "central_meridian", d2r], ["lat0", "latitude_of_origin", d2r], ["lat0", "standard_parallel_1", d2r], ["lat1", "standard_parallel_1", d2r], ["lat2", "standard_parallel_2", d2r], ["azimuth", "Azimuth"], ["alpha", "azimuth", d2r], ["srsCode", "name"]];
  k2["forEach"](j2);
  !b2["long0"] && b2["longc"] && (b2["projName"] === "Albers_Conic_Equal_Area" || b2["projName"] === "Lambert_Azimuthal_Equal_Area") && (b2["long0"] = b2["longc"]);
  if (!b2["lat_ts"] && b2["lat1"] && (b2["projName"] === "Stereographic_South_Pole" || b2["projName"] === "Polar Stereographic (variant B)")) b2["lat0"] = d2r(b2["lat1"] > 0 ? 90 : -90), b2["lat_ts"] = b2["lat1"];
  else !b2["lat_ts"] && b2["lat0"] && b2["projName"] === "Polar_Stereographic" && (b2["lat_ts"] = b2["lat0"], b2["lat0"] = d2r(b2["lat0"] > 0 ? 90 : -90));
}
function b$d(wkt) {
  var lisp = parseString(wkt), type = lisp["shift"](), name = lisp["shift"]();
  lisp["unshift"](["name", name]), lisp["unshift"](["type", type]);
  var obj = {};
  return sExpr(lisp, obj), cleanWKT(obj), obj;
}
function defs(d2) {
  var e2 = this;
  if (arguments["length"] === 2) {
    var f2 = arguments[1];
    typeof f2 === "string" ? f2["charAt"](0) === "+" ? defs[d2] = c$4(arguments[1]) : defs[d2] = b$d(arguments[1]) : defs[d2] = f2;
  } else {
    if (arguments["length"] === 1) {
      if (Array["isArray"](d2)) return d2["map"](function(g2) {
        Array["isArray"](g2) ? defs["apply"](e2, g2) : defs(g2);
      });
      else {
        if (typeof d2 === "string") {
          if (d2 in defs) return defs[d2];
        } else {
          if ("EPSG" in d2) defs["EPSG:" + d2["EPSG"]] = d2;
          else {
            if ("ESRI" in d2) defs["ESRI:" + d2["ESRI"]] = d2;
            else "IAU2000" in d2 ? defs["IAU2000:" + d2["IAU2000"]] = d2 : console["log"](d2);
          }
        }
      }
      return;
    }
  }
}
a$9(defs);
function testObj(e2) {
  return typeof e2 === "string";
}
function testDef(e2) {
  return e2 in defs;
}
var codeWords = ["PROJECTEDCRS", "PROJCRS", "GEOGCS", "GEOCCS", "PROJCS", "LOCAL_CS", "GEODCRS", "GEODETICCRS", "GEODETICDATUM", "ENGCRS", "ENGINEERINGCRS"];
function testWKT(e2) {
  return codeWords["some"](function(f2) {
    return e2["indexOf"](f2) > -1;
  });
}
var codes = ["3857", "900913", "3785", "102113"];
function checkMercator(e2) {
  var f2 = match(e2, "authority");
  if (!f2) return;
  var g2 = match(f2, "epsg");
  return g2 && codes["indexOf"](g2) > -1;
}
function checkProjStr(e2) {
  var f2 = match(e2, "extension");
  if (!f2) return;
  return match(f2, "proj4");
}
function testProj(e2) {
  return e2[0] === "+";
}
function parse(e2) {
  if (testObj(e2)) {
    if (testDef(e2)) return defs[e2];
    if (testWKT(e2)) {
      var f2 = b$d(e2);
      if (checkMercator(f2)) return defs["EPSG:3857"];
      var g2 = checkProjStr(f2);
      if (g2) return c$4(g2);
      return f2;
    }
    if (testProj(e2)) return c$4(e2);
  } else return e2;
}
function b$c(destination, source) {
  destination = destination || {};
  var value, property;
  if (!source) return destination;
  for (property in source) {
    value = source[property], value !== void 0 && (destination[property] = value);
  }
  return destination;
}
function e$6(eccent, sinphi, cosphi) {
  var con = eccent * sinphi;
  return cosphi / Math["sqrt"](1 - con * con);
}
function a$8(x2) {
  return x2 < 0 ? -1 : 1;
}
function b$b(x2) {
  return Math["abs"](x2) <= SPI ? x2 : x2 - a$8(x2) * TWO_PI;
}
function b$a(eccent, phi, sinphi) {
  var con = eccent * sinphi, com = 0.5 * eccent;
  return con = Math["pow"]((1 - con) / (1 + con), com), Math["tan"](0.5 * (HALF_PI - phi)) / con;
}
function e$5(eccent, ts) {
  var eccnth = 0.5 * eccent, con, dphi, phi = HALF_PI - 2 * Math["atan"](ts);
  for (var i2 = 0; i2 <= 15; i2++) {
    con = eccent * Math["sin"](phi), dphi = HALF_PI - 2 * Math["atan"](ts * Math["pow"]((1 - con) / (1 + con), eccnth)) - phi, phi += dphi;
    if (Math["abs"](dphi) <= 1e-10) return phi;
  }
  return -9999;
}
function init$x() {
  var e2 = this["b"] / this["a"];
  this["es"] = 1 - e2 * e2, !("x0" in this) && (this["x0"] = 0), !("y0" in this) && (this["y0"] = 0), this["e"] = Math["sqrt"](this["es"]), this["lat_ts"] ? this["sphere"] ? this["k0"] = Math["cos"](this["lat_ts"]) : this["k0"] = e$6(this["e"], Math["sin"](this["lat_ts"]), Math["cos"](this["lat_ts"])) : !this["k0"] && (this["k"] ? this["k0"] = this["k"] : this["k0"] = 1);
}
function forward$v(e2) {
  var f2 = e2["x"], g2 = e2["y"];
  if (g2 * R2D > 90 && g2 * R2D < -90 && f2 * R2D > 180 && f2 * R2D < -180) return null;
  var h2, i2;
  if (Math["abs"](Math["abs"](g2) - HALF_PI) <= EPSLN) return null;
  else {
    if (this["sphere"]) h2 = this["x0"] + this["a"] * this["k0"] * b$b(f2 - this["long0"]), i2 = this["y0"] + this["a"] * this["k0"] * Math["log"](Math["tan"](FORTPI + 0.5 * g2));
    else {
      var j2 = Math["sin"](g2), k2 = b$a(this["e"], g2, j2);
      h2 = this["x0"] + this["a"] * this["k0"] * b$b(f2 - this["long0"]), i2 = this["y0"] - this["a"] * this["k0"] * Math["log"](k2);
    }
    return e2["x"] = h2, e2["y"] = i2, e2;
  }
}
function inverse$v(e2) {
  var f2 = e2["x"] - this["x0"], g2 = e2["y"] - this["y0"], h2, i2;
  if (this["sphere"]) i2 = HALF_PI - 2 * Math["atan"](Math["exp"](-g2 / (this["a"] * this["k0"])));
  else {
    var j2 = Math["exp"](-g2 / (this["a"] * this["k0"]));
    i2 = e$5(this["e"], j2);
    if (i2 === -9999) return null;
  }
  return h2 = b$b(this["long0"] + f2 / (this["a"] * this["k0"])), e2["x"] = h2, e2["y"] = i2, e2;
}
var names$y = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
const a$7 = { "init": init$x, "forward": forward$v, "inverse": inverse$v, "names": names$y };
function init$w() {
}
function identity(a2) {
  return a2;
}
var names$x = ["longlat", "identity"];
const b$9 = { "init": init$w, "forward": identity, "inverse": identity, "names": names$x };
var projs = [a$7, b$9], names$w = {}, projStore = [];
function add(c2, d2) {
  var e2 = projStore["length"];
  if (!c2["names"]) return console["log"](d2), !![];
  return projStore[e2] = c2, c2["names"]["forEach"](function(f2) {
    names$w[f2["toLowerCase"]()] = e2;
  }), this;
}
function get(c2) {
  if (!c2) return ![];
  var d2 = c2["toLowerCase"]();
  if (typeof names$w[d2] !== "undefined" && projStore[names$w[d2]]) return projStore[names$w[d2]];
}
function start() {
  projs["forEach"](add);
}
const c$3 = { "start": start, "add": add, "get": get };
var exports$1 = {};
exports$1["MERIT"] = { "a": 6378137, "rf": 298.257, "ellipseName": "MERIT 1983" }, exports$1["SGS85"] = { "a": 6378136, "rf": 298.257, "ellipseName": "Soviet Geodetic System 85" }, exports$1["GRS80"] = { "a": 6378137, "rf": 298.257222101, "ellipseName": "GRS 1980(IUGG, 1980)" }, exports$1["IAU76"] = { "a": 6378140, "rf": 298.257, "ellipseName": "IAU 1976" }, exports$1["airy"] = { "a": 6377563396e-3, "b": 635625691e-2, "ellipseName": "Airy 1830" }, exports$1["APL4"] = { "a": 6378137, "rf": 298.25, "ellipseName": "Appl. Physics. 1965" }, exports$1["NWL9D"] = { "a": 6378145, "rf": 298.25, "ellipseName": "Naval Weapons Lab., 1965" }, exports$1["mod_airy"] = { "a": 6377340189e-3, "b": 6356034446e-3, "ellipseName": "Modified Airy" }, exports$1["andrae"] = { "a": 637710443e-2, "rf": 300, "ellipseName": "Andrae 1876 (Den., Iclnd.)" }, exports$1["aust_SA"] = { "a": 6378160, "rf": 298.25, "ellipseName": "Australian Natl & S. Amer. 1969" }, exports$1["GRS67"] = { "a": 6378160, "rf": 298.247167427, "ellipseName": "GRS 67(IUGG 1967)" }, exports$1["bessel"] = { "a": 6377397155e-3, "rf": 299.1528128, "ellipseName": "Bessel 1841" }, exports$1["bess_nam"] = { "a": 6377483865e-3, "rf": 299.1528128, "ellipseName": "Bessel 1841 (Namibia)" }, exports$1["clrk66"] = { "a": 63782064e-1, "b": 63565838e-1, "ellipseName": "Clarke 1866" }, exports$1["clrk80"] = { "a": 6378249145e-3, "rf": 293.4663, "ellipseName": "Clarke 1880 mod." }, exports$1["clrk80ign"] = { "a": 63782492e-1, "b": 6356515, "rf": 293.4660213, "ellipseName": "Clarke 1880 (IGN)" }, exports$1["clrk58"] = { "a": 6378293645208759e-9, "rf": 294.2606763692654, "ellipseName": "Clarke 1858" }, exports$1["CPM"] = { "a": 63757387e-1, "rf": 334.29, "ellipseName": "Comm. des Poids et Mesures 1799" }, exports$1["delmbr"] = { "a": 6376428, "rf": 311.5, "ellipseName": "Delambre 1810 (Belgium)" }, exports$1["engelis"] = { "a": 637813605e-2, "rf": 298.2566, "ellipseName": "Engelis 1985" }, exports$1["evrst30"] = { "a": 6377276345e-3, "rf": 300.8017, "ellipseName": "Everest 1830" }, exports$1["evrst48"] = { "a": 6377304063e-3, "rf": 300.8017, "ellipseName": "Everest 1948" }, exports$1["evrst56"] = { "a": 6377301243e-3, "rf": 300.8017, "ellipseName": "Everest 1956" }, exports$1["evrst69"] = { "a": 6377295664e-3, "rf": 300.8017, "ellipseName": "Everest 1969" }, exports$1["evrstSS"] = { "a": 6377298556e-3, "rf": 300.8017, "ellipseName": "Everest (Sabah & Sarawak)" }, exports$1["fschr60"] = { "a": 6378166, "rf": 298.3, "ellipseName": "Fischer (Mercury Datum) 1960" }, exports$1["fschr60m"] = { "a": 6378155, "rf": 298.3, "ellipseName": "Fischer 1960" }, exports$1["fschr68"] = { "a": 6378150, "rf": 298.3, "ellipseName": "Fischer 1968" }, exports$1["helmert"] = { "a": 6378200, "rf": 298.3, "ellipseName": "Helmert 1906" }, exports$1["hough"] = { "a": 6378270, "rf": 297, "ellipseName": "Hough" }, exports$1["intl"] = { "a": 6378388, "rf": 297, "ellipseName": "International 1909 (Hayford)" }, exports$1["kaula"] = { "a": 6378163, "rf": 298.24, "ellipseName": "Kaula 1961" }, exports$1["lerch"] = { "a": 6378139, "rf": 298.257, "ellipseName": "Lerch 1979" }, exports$1["mprts"] = { "a": 6397300, "rf": 191, "ellipseName": "Maupertius 1738" }, exports$1["new_intl"] = { "a": 63781575e-1, "b": 63567722e-1, "ellipseName": "New International 1967" }, exports$1["plessis"] = { "a": 6376523, "rf": 6355863, "ellipseName": "Plessis 1817 (France)" }, exports$1["krass"] = { "a": 6378245, "rf": 298.3, "ellipseName": "Krassovsky, 1942" }, exports$1["SEasia"] = { "a": 6378155, "b": 63567733205e-4, "ellipseName": "Southeast Asia" }, exports$1["walbeck"] = { "a": 6376896, "b": 63558348467e-4, "ellipseName": "Walbeck" }, exports$1["WGS60"] = { "a": 6378165, "rf": 298.3, "ellipseName": "WGS 60" }, exports$1["WGS66"] = { "a": 6378145, "rf": 298.25, "ellipseName": "WGS 66" }, exports$1["WGS7"] = { "a": 6378135, "rf": 298.26, "ellipseName": "WGS 72" };
var WGS84 = exports$1["WGS84"] = { "a": 6378137, "rf": 298.257223563, "ellipseName": "WGS 84" };
exports$1["sphere"] = { "a": 6370997, "b": 6370997, "ellipseName": "Normal Sphere (r=6370997)" };
function eccentricity(c2, d2, f2, g2) {
  var h2 = c2 * c2, i2 = d2 * d2, j2 = (h2 - i2) / h2, k2 = 0;
  g2 ? (c2 *= 1 - j2 * (SIXTH + j2 * (RA4 + j2 * RA6)), h2 = c2 * c2, j2 = 0) : k2 = Math["sqrt"](j2);
  var l2 = (h2 - i2) / i2;
  return { "es": j2, "e": k2, "ep2": l2 };
}
function sphere(c2, d2, e2, f2, g2) {
  if (!c2) {
    var h2 = match(exports$1, f2);
    !h2 && (h2 = WGS84), c2 = h2["a"], d2 = h2["b"], e2 = h2["rf"];
  }
  return e2 && !d2 && (d2 = (1 - 1 / e2) * c2), (e2 === 0 || Math["abs"](c2 - d2) < EPSLN) && (g2 = !![], d2 = c2), { "a": c2, "b": d2, "rf": e2, "sphere": g2 };
}
var exports = {};
exports["wgs84"] = { "towgs84": "0,0,0", "ellipse": "WGS84", "datumName": "WGS84" }, exports["ch1903"] = { "towgs84": "674.374,15.056,405.346", "ellipse": "bessel", "datumName": "swiss" }, exports["ggrs87"] = { "towgs84": "-199.87,74.79,246.62", "ellipse": "GRS80", "datumName": "Greek_Geodetic_Reference_System_1987" }, exports["nad83"] = { "towgs84": "0,0,0", "ellipse": "GRS80", "datumName": "North_American_Datum_1983" }, exports["nad27"] = { "nadgrids": "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat", "ellipse": "clrk66", "datumName": "North_American_Datum_1927" }, exports["potsdam"] = { "towgs84": "598.1,73.7,418.2,0.202,0.045,-2.455,6.7", "ellipse": "bessel", "datumName": "Potsdam Rauenberg 1950 DHDN" }, exports["carthage"] = { "towgs84": "-263.0,6.0,431.0", "ellipse": "clark80", "datumName": "Carthage 1934 Tunisia" }, exports["hermannskogel"] = { "towgs84": "577.326,90.129,463.919,5.137,1.474,5.297,2.4232", "ellipse": "bessel", "datumName": "Hermannskogel" }, exports["militargeographische_institut"] = { "towgs84": "577.326,90.129,463.919,5.137,1.474,5.297,2.4232", "ellipse": "bessel", "datumName": "Militar-Geographische Institut" }, exports["osni52"] = { "towgs84": "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "ellipse": "airy", "datumName": "Irish National" }, exports["ire65"] = { "towgs84": "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "ellipse": "mod_airy", "datumName": "Ireland 1965" }, exports["rassadiran"] = { "towgs84": "-133.63,-157.5,-158.62", "ellipse": "intl", "datumName": "Rassadiran" }, exports["nzgd49"] = { "towgs84": "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "ellipse": "intl", "datumName": "New Zealand Geodetic Datum 1949" }, exports["osgb36"] = { "towgs84": "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "ellipse": "airy", "datumName": "Airy 1830" }, exports["s_jtsk"] = { "towgs84": "589,76,480", "ellipse": "bessel", "datumName": "S-JTSK (Ferro)" }, exports["beduaram"] = { "towgs84": "-106,-87,188", "ellipse": "clrk80", "datumName": "Beduaram" }, exports["gunung_segara"] = { "towgs84": "-403,684,41", "ellipse": "bessel", "datumName": "Gunung Segara Jakarta" }, exports["rnb72"] = { "towgs84": "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1", "ellipse": "intl", "datumName": "Reseau National Belge 1972" };
function datum(c2, d2, e2, f2, g2, h2, i2) {
  var j2 = {};
  return c2 === void 0 || c2 === "none" ? j2["datum_type"] = PJD_NODATUM : j2["datum_type"] = PJD_WGS84, d2 && (j2["datum_params"] = d2["map"](parseFloat), (j2["datum_params"][0] !== 0 || j2["datum_params"][1] !== 0 || j2["datum_params"][2] !== 0) && (j2["datum_type"] = PJD_3PARAM), j2["datum_params"]["length"] > 3 && ((j2["datum_params"][3] !== 0 || j2["datum_params"][4] !== 0 || j2["datum_params"][5] !== 0 || j2["datum_params"][6] !== 0) && (j2["datum_type"] = PJD_7PARAM, j2["datum_params"][3] *= SEC_TO_RAD, j2["datum_params"][4] *= SEC_TO_RAD, j2["datum_params"][5] *= SEC_TO_RAD, j2["datum_params"][6] = j2["datum_params"][6] / 1e6 + 1))), i2 && (j2["datum_type"] = PJD_GRIDSHIFT, j2["grids"] = i2), j2["a"] = e2, j2["b"] = f2, j2["es"] = g2, j2["ep2"] = h2, j2;
}
var loadedNadgrids = {};
function nadgrid(a2, b2) {
  var c2 = new DataView(b2), d2 = detectLittleEndian(c2), e2 = readHeader(c2, d2), f2 = readSubgrids(c2, e2, d2), g2 = { "header": e2, "subgrids": f2 };
  return loadedNadgrids[a2] = g2, g2;
}
function getNadgrids(a2) {
  if (a2 === void 0) return null;
  var b2 = a2["split"](",");
  return b2["map"](parseNadgridString);
}
function parseNadgridString(a2) {
  if (a2["length"] === 0) return null;
  var b2 = a2[0] === "@";
  b2 && (a2 = a2["slice"](1));
  if (a2 === "null") return { "name": "null", "mandatory": !b2, "grid": null, "isNull": !![] };
  return { "name": a2, "mandatory": !b2, "grid": loadedNadgrids[a2] || null, "isNull": ![] };
}
function secondsToRadians(a2) {
  return a2 / 3600 * Math["PI"] / 180;
}
function detectLittleEndian(a2) {
  var b2 = a2["getInt32"](8, ![]);
  if (b2 === 11) return ![];
  return b2 = a2["getInt32"](8, !![]), b2 !== 11 && console["warn"]("Failed to detect nadgrid endian-ness, defaulting to little-endian"), !![];
}
function readHeader(a2, b2) {
  return { "nFields": a2["getInt32"](8, b2), "nSubgridFields": a2["getInt32"](24, b2), "nSubgrids": a2["getInt32"](40, b2), "shiftType": decodeString(a2, 56, 56 + 8)["trim"](), "fromSemiMajorAxis": a2["getFloat64"](120, b2), "fromSemiMinorAxis": a2["getFloat64"](136, b2), "toSemiMajorAxis": a2["getFloat64"](152, b2), "toSemiMinorAxis": a2["getFloat64"](168, b2) };
}
function decodeString(a2, b2, c2) {
  return String["fromCharCode"]["apply"](null, new Uint8Array(a2["buffer"]["slice"](b2, c2)));
}
function readSubgrids(a2, b2, c2) {
  var d2 = 176, e2 = [];
  for (var f2 = 0; f2 < b2["nSubgrids"]; f2++) {
    var g2 = readGridHeader(a2, d2, c2), h2 = readGridNodes(a2, d2, g2, c2), j2 = Math["round"](1 + (g2["upperLongitude"] - g2["lowerLongitude"]) / g2["longitudeInterval"]), k2 = Math["round"](1 + (g2["upperLatitude"] - g2["lowerLatitude"]) / g2["latitudeInterval"]);
    e2["push"]({ "ll": [secondsToRadians(g2["lowerLongitude"]), secondsToRadians(g2["lowerLatitude"])], "del": [secondsToRadians(g2["longitudeInterval"]), secondsToRadians(g2["latitudeInterval"])], "lim": [j2, k2], "count": g2["gridNodeCount"], "cvs": mapNodes(h2) }), d2 += 176 + g2["gridNodeCount"] * 16;
  }
  return e2;
}
function mapNodes(a2) {
  return a2["map"](function(b2) {
    return [secondsToRadians(b2["longitudeShift"]), secondsToRadians(b2["latitudeShift"])];
  });
}
function readGridHeader(a2, b2, c2) {
  return { "name": decodeString(a2, b2 + 8, b2 + 16)["trim"](), "parent": decodeString(a2, b2 + 24, b2 + 24 + 8)["trim"](), "lowerLatitude": a2["getFloat64"](b2 + 72, c2), "upperLatitude": a2["getFloat64"](b2 + 88, c2), "lowerLongitude": a2["getFloat64"](b2 + 104, c2), "upperLongitude": a2["getFloat64"](b2 + 120, c2), "latitudeInterval": a2["getFloat64"](b2 + 136, c2), "longitudeInterval": a2["getFloat64"](b2 + 152, c2), "gridNodeCount": a2["getInt32"](b2 + 168, c2) };
}
function readGridNodes(a2, b2, c2, d2) {
  var e2 = b2 + 176, f2 = 16, g2 = [];
  for (var h2 = 0; h2 < c2["gridNodeCount"]; h2++) {
    var j2 = { "latitudeShift": a2["getFloat32"](e2 + h2 * f2, d2), "longitudeShift": a2["getFloat32"](e2 + h2 * f2 + 4, d2), "latitudeAccuracy": a2["getFloat32"](e2 + h2 * f2 + 8, d2), "longitudeAccuracy": a2["getFloat32"](e2 + h2 * f2 + 12, d2) };
    g2["push"](j2);
  }
  return g2;
}
function Projection(i2, j2) {
  if (!(this instanceof Projection)) return new Projection(i2);
  j2 = j2 || function(r2) {
    if (r2) throw r2;
  };
  var k2 = parse(i2);
  if (typeof k2 !== "object") {
    j2("Could not parse to valid json: " + i2);
    return;
  }
  var l2 = Projection["projections"]["get"](k2["projName"]);
  if (!l2) {
    j2("Could not get projection name from: " + i2);
    return;
  }
  if (k2["datumCode"] && k2["datumCode"] !== "none") {
    var m2 = match(exports, k2["datumCode"]);
    m2 && (k2["datum_params"] = k2["datum_params"] || (m2["towgs84"] ? m2["towgs84"]["split"](",") : null), k2["ellps"] = m2["ellipse"], k2["datumName"] = m2["datumName"] ? m2["datumName"] : k2["datumCode"]);
  }
  k2["k0"] = k2["k0"] || 1, k2["axis"] = k2["axis"] || "enu", k2["ellps"] = k2["ellps"] || "wgs84", k2["lat1"] = k2["lat1"] || k2["lat0"];
  var n2 = sphere(k2["a"], k2["b"], k2["rf"], k2["ellps"], k2["sphere"]), o2 = eccentricity(n2["a"], n2["b"], n2["rf"], k2["R_A"]), p2 = getNadgrids(k2["nadgrids"]), q2 = k2["datum"] || datum(k2["datumCode"], k2["datum_params"], n2["a"], n2["b"], o2["es"], o2["ep2"], p2);
  b$c(this, k2), b$c(this, l2), this["a"] = n2["a"], this["b"] = n2["b"], this["rf"] = n2["rf"], this["sphere"] = n2["sphere"], this["es"] = o2["es"], this["e"] = o2["e"], this["ep2"] = o2["ep2"], this["datum"] = q2, this["init"](), j2(null, this);
}
Projection["projections"] = c$3, Projection["projections"]["start"]();
function compareDatums(a2, b2) {
  if (a2["datum_type"] !== b2["datum_type"]) return ![];
  else {
    if (a2["a"] !== b2["a"] || Math["abs"](a2["es"] - b2["es"]) > 5e-11) return ![];
    else {
      if (a2["datum_type"] === PJD_3PARAM) return a2["datum_params"][0] === b2["datum_params"][0] && a2["datum_params"][1] === b2["datum_params"][1] && a2["datum_params"][2] === b2["datum_params"][2];
      else return a2["datum_type"] === PJD_7PARAM ? a2["datum_params"][0] === b2["datum_params"][0] && a2["datum_params"][1] === b2["datum_params"][1] && a2["datum_params"][2] === b2["datum_params"][2] && a2["datum_params"][3] === b2["datum_params"][3] && a2["datum_params"][4] === b2["datum_params"][4] && a2["datum_params"][5] === b2["datum_params"][5] && a2["datum_params"][6] === b2["datum_params"][6] : !![];
    }
  }
}
function geodeticToGeocentric(b2, c2, d2) {
  var e2 = b2["x"], f2 = b2["y"], g2 = b2["z"] ? b2["z"] : 0, h2, i2, j2, k2;
  if (f2 < -HALF_PI && f2 > -1.001 * HALF_PI) f2 = -HALF_PI;
  else {
    if (f2 > HALF_PI && f2 < 1.001 * HALF_PI) f2 = HALF_PI;
    else {
      if (f2 < -HALF_PI) return { "x": -Infinity, "y": -Infinity, "z": b2["z"] };
      else {
        if (f2 > HALF_PI) return { "x": Infinity, "y": Infinity, "z": b2["z"] };
      }
    }
  }
  return e2 > Math["PI"] && (e2 -= 2 * Math["PI"]), i2 = Math["sin"](f2), k2 = Math["cos"](f2), j2 = i2 * i2, h2 = d2 / Math["sqrt"](1 - c2 * j2), { "x": (h2 + g2) * k2 * Math["cos"](e2), "y": (h2 + g2) * k2 * Math["sin"](e2), "z": (h2 * (1 - c2) + g2) * i2 };
}
function geocentricToGeodetic(c2, d2, e2, f2) {
  var g2 = 1e-12, h2 = g2 * g2, i2 = 30, j2, k2, l2, m2, n2, o2, q2, r2, s2, t2, u2, v2, w2, x2 = c2["x"], y2 = c2["y"], z2 = c2["z"] ? c2["z"] : 0, A5, B2, C2;
  j2 = Math["sqrt"](x2 * x2 + y2 * y2), k2 = Math["sqrt"](x2 * x2 + y2 * y2 + z2 * z2);
  if (j2 / e2 < g2) {
    A5 = 0;
    if (k2 / e2 < g2) return B2 = HALF_PI, C2 = -f2, { "x": c2["x"], "y": c2["y"], "z": c2["z"] };
  } else A5 = Math["atan2"](y2, x2);
  l2 = z2 / k2, m2 = j2 / k2, n2 = 1 / Math["sqrt"](1 - d2 * (2 - d2) * m2 * m2), r2 = m2 * (1 - d2) * n2, s2 = l2 * n2, w2 = 0;
  do {
    w2++, q2 = e2 / Math["sqrt"](1 - d2 * s2 * s2), C2 = j2 * r2 + z2 * s2 - q2 * (1 - d2 * s2 * s2), o2 = d2 * q2 / (q2 + C2), n2 = 1 / Math["sqrt"](1 - o2 * (2 - o2) * m2 * m2), t2 = m2 * (1 - o2) * n2, u2 = l2 * n2, v2 = u2 * r2 - t2 * s2, r2 = t2, s2 = u2;
  } while (v2 * v2 > h2 && w2 < i2);
  return B2 = Math["atan"](u2 / Math["abs"](t2)), { "x": A5, "y": B2, "z": C2 };
}
function geocentricToWgs84(a2, b2, c2) {
  if (b2 === PJD_3PARAM) return { "x": a2["x"] + c2[0], "y": a2["y"] + c2[1], "z": a2["z"] + c2[2] };
  else {
    if (b2 === PJD_7PARAM) {
      var d2 = c2[0], e2 = c2[1], f2 = c2[2], g2 = c2[3], h2 = c2[4], i2 = c2[5], j2 = c2[6];
      return { "x": j2 * (a2["x"] - i2 * a2["y"] + h2 * a2["z"]) + d2, "y": j2 * (i2 * a2["x"] + a2["y"] - g2 * a2["z"]) + e2, "z": j2 * (-h2 * a2["x"] + g2 * a2["y"] + a2["z"]) + f2 };
    }
  }
}
function geocentricFromWgs84(a2, b2, c2) {
  if (b2 === PJD_3PARAM) return { "x": a2["x"] - c2[0], "y": a2["y"] - c2[1], "z": a2["z"] - c2[2] };
  else {
    if (b2 === PJD_7PARAM) {
      var d2 = c2[0], e2 = c2[1], f2 = c2[2], g2 = c2[3], h2 = c2[4], i2 = c2[5], j2 = c2[6], k2 = (a2["x"] - d2) / j2, l2 = (a2["y"] - e2) / j2, m2 = (a2["z"] - f2) / j2;
      return { "x": k2 + i2 * l2 - h2 * m2, "y": -i2 * k2 + l2 + g2 * m2, "z": h2 * k2 - g2 * l2 + m2 };
    }
  }
}
function checkParams(b2) {
  return b2 === PJD_3PARAM || b2 === PJD_7PARAM;
}
function a$6(source, dest, point) {
  if (compareDatums(source, dest)) return point;
  if (source["datum_type"] === PJD_NODATUM || dest["datum_type"] === PJD_NODATUM) return point;
  var source_a = source["a"], source_es = source["es"];
  if (source["datum_type"] === PJD_GRIDSHIFT) {
    var gridShiftCode = applyGridShift(source, ![], point);
    if (gridShiftCode !== 0) return void 0;
    source_a = SRS_WGS84_SEMIMAJOR, source_es = SRS_WGS84_ESQUARED;
  }
  var dest_a = dest["a"], dest_b = dest["b"], dest_es = dest["es"];
  dest["datum_type"] === PJD_GRIDSHIFT && (dest_a = SRS_WGS84_SEMIMAJOR, dest_b = SRS_WGS84_SEMIMINOR, dest_es = SRS_WGS84_ESQUARED);
  if (source_es === dest_es && source_a === dest_a && !checkParams(source["datum_type"]) && !checkParams(dest["datum_type"])) return point;
  point = geodeticToGeocentric(point, source_es, source_a);
  checkParams(source["datum_type"]) && (point = geocentricToWgs84(point, source["datum_type"], source["datum_params"]));
  checkParams(dest["datum_type"]) && (point = geocentricFromWgs84(point, dest["datum_type"], dest["datum_params"]));
  point = geocentricToGeodetic(point, dest_es, dest_a, dest_b);
  if (dest["datum_type"] === PJD_GRIDSHIFT) {
    var destGridShiftResult = applyGridShift(dest, !![], point);
    if (destGridShiftResult !== 0) return void 0;
  }
  return point;
}
function applyGridShift(b2, c2, d2) {
  if (b2["grids"] === null || b2["grids"]["length"] === 0) return console["log"]("Grid shift grids not found"), -1;
  var e2 = { "x": -d2["x"], "y": d2["y"] }, f2 = { "x": Number["NaN"], "y": Number["NaN"] }, h2 = [];
  v: for (var k2 = 0; k2 < b2["grids"]["length"]; k2++) {
    var l2 = b2["grids"][k2];
    h2["push"](l2["name"]);
    if (l2["isNull"]) {
      f2 = e2;
      break;
    }
    l2["mandatory"];
    if (l2["grid"] === null) {
      if (l2["mandatory"]) return console["log"]("Unable to find mandatory grid '" + l2["name"] + "'"), -1;
      continue;
    }
    var m2 = l2["grid"]["subgrids"];
    for (var n2 = 0, o2 = m2["length"]; n2 < o2; n2++) {
      var p2 = m2[n2], q2 = (Math["abs"](p2["del"][1]) + Math["abs"](p2["del"][0])) / 1e4, r2 = p2["ll"][0] - q2, s2 = p2["ll"][1] - q2, t2 = p2["ll"][0] + (p2["lim"][0] - 1) * p2["del"][0] + q2, u2 = p2["ll"][1] + (p2["lim"][1] - 1) * p2["del"][1] + q2;
      if (s2 > e2["y"] || r2 > e2["x"] || u2 < e2["y"] || t2 < e2["x"]) continue;
      f2 = applySubgridShift(e2, c2, p2);
      if (!isNaN(f2["x"])) break v;
    }
  }
  if (isNaN(f2["x"])) return console["log"]("Failed to find a grid shift table for location '" + -e2["x"] * R2D + " " + e2["y"] * R2D + " tried: '" + h2 + "'"), -1;
  return d2["x"] = -f2["x"], d2["y"] = f2["y"], 0;
}
function applySubgridShift(b2, c2, d2) {
  var e2 = { "x": Number["NaN"], "y": Number["NaN"] };
  if (isNaN(b2["x"])) return e2;
  var f2 = { "x": b2["x"], "y": b2["y"] };
  f2["x"] -= d2["ll"][0], f2["y"] -= d2["ll"][1], f2["x"] = b$b(f2["x"] - Math["PI"]) + Math["PI"];
  var g2 = nadInterpolate(f2, d2);
  if (c2) {
    if (isNaN(g2["x"])) return e2;
    g2["x"] = f2["x"] - g2["x"], g2["y"] = f2["y"] - g2["y"];
    var h2 = 9, j2 = 1e-12, k2, l2;
    do {
      l2 = nadInterpolate(g2, d2);
      if (isNaN(l2["x"])) {
        console["log"]("Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.");
        break;
      }
      k2 = { "x": f2["x"] - (l2["x"] + g2["x"]), "y": f2["y"] - (l2["y"] + g2["y"]) }, g2["x"] += k2["x"], g2["y"] += k2["y"];
    } while (h2-- && Math["abs"](k2["x"]) > j2 && Math["abs"](k2["y"]) > j2);
    if (h2 < 0) return console["log"]("Inverse grid shift iterator failed to converge."), e2;
    e2["x"] = b$b(g2["x"] + d2["ll"][0]), e2["y"] = g2["y"] + d2["ll"][1];
  } else !isNaN(g2["x"]) && (e2["x"] = b2["x"] + g2["x"], e2["y"] = b2["y"] + g2["y"]);
  return e2;
}
function nadInterpolate(b2, c2) {
  var d2 = { "x": b2["x"] / c2["del"][0], "y": b2["y"] / c2["del"][1] }, e2 = { "x": Math["floor"](d2["x"]), "y": Math["floor"](d2["y"]) }, f2 = { "x": d2["x"] - 1 * e2["x"], "y": d2["y"] - 1 * e2["y"] }, g2 = { "x": Number["NaN"], "y": Number["NaN"] }, h2;
  if (e2["x"] < 0 || e2["x"] >= c2["lim"][0]) return g2;
  if (e2["y"] < 0 || e2["y"] >= c2["lim"][1]) return g2;
  h2 = e2["y"] * c2["lim"][0] + e2["x"];
  var i2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] };
  h2++;
  var j2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] };
  h2 += c2["lim"][0];
  var k2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] };
  h2--;
  var l2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] }, m2 = f2["x"] * f2["y"], n2 = f2["x"] * (1 - f2["y"]), o2 = (1 - f2["x"]) * (1 - f2["y"]), p2 = (1 - f2["x"]) * f2["y"];
  return g2["x"] = o2 * i2["x"] + n2 * j2["x"] + p2 * l2["x"] + m2 * k2["x"], g2["y"] = o2 * i2["y"] + n2 * j2["y"] + p2 * l2["y"] + m2 * k2["y"], g2;
}
function b$8(crs, denorm, point) {
  var xin = point["x"], yin = point["y"], zin = point["z"] || 0, v2, t2, i2, out = {};
  for (i2 = 0; i2 < 3; i2++) {
    if (denorm && i2 === 2 && point["z"] === void 0) continue;
    if (i2 === 0) v2 = xin, "ew"["indexOf"](crs["axis"][i2]) !== -1 ? t2 = "x" : t2 = "y";
    else i2 === 1 ? (v2 = yin, "ns"["indexOf"](crs["axis"][i2]) !== -1 ? t2 = "y" : t2 = "x") : (v2 = zin, t2 = "z");
    switch (crs["axis"][i2]) {
      case "e":
        out[t2] = v2;
        break;
      case "w":
        out[t2] = -v2;
        break;
      case "n":
        out[t2] = v2;
        break;
      case "s":
        out[t2] = -v2;
        break;
      case "u":
        point[t2] !== void 0 && (out["z"] = v2);
        break;
      case "d":
        point[t2] !== void 0 && (out["z"] = -v2);
        break;
      default:
        return null;
    }
  }
  return out;
}
function d$5(array) {
  var out = { "x": array[0], "y": array[1] };
  return array["length"] > 2 && (out["z"] = array[2]), array["length"] > 3 && (out["m"] = array[3]), out;
}
function e$4(point) {
  checkCoord(point["x"]), checkCoord(point["y"]);
}
function checkCoord(a2) {
  if (typeof Number["isFinite"] === "function") {
    if (Number["isFinite"](a2)) return;
    throw new TypeError("coordinates must be finite numbers");
  }
  if (typeof a2 !== "number" || a2 !== a2 || !isFinite(a2)) throw new TypeError("coordinates must be finite numbers");
}
function checkNotWGS(f2, g2) {
  return (f2["datum"]["datum_type"] === PJD_3PARAM || f2["datum"]["datum_type"] === PJD_7PARAM || f2["datum"]["datum_type"] === PJD_GRIDSHIFT) && g2["datumCode"] !== "WGS84" || (g2["datum"]["datum_type"] === PJD_3PARAM || g2["datum"]["datum_type"] === PJD_7PARAM || g2["datum"]["datum_type"] === PJD_GRIDSHIFT) && f2["datumCode"] !== "WGS84";
}
function transform(f2, g2, h2, i2) {
  var j2;
  Array["isArray"](h2) ? h2 = d$5(h2) : h2 = { "x": h2["x"], "y": h2["y"], "z": h2["z"], "m": h2["m"] };
  var k2 = h2["z"] !== void 0;
  e$4(h2);
  f2["datum"] && g2["datum"] && checkNotWGS(f2, g2) && (j2 = new Projection("WGS84"), h2 = transform(f2, j2, h2, i2), f2 = j2);
  i2 && f2["axis"] !== "enu" && (h2 = b$8(f2, ![], h2));
  if (f2["projName"] === "longlat") h2 = { "x": h2["x"] * D2R$1, "y": h2["y"] * D2R$1, "z": h2["z"] || 0 };
  else {
    f2["to_meter"] && (h2 = { "x": h2["x"] * f2["to_meter"], "y": h2["y"] * f2["to_meter"], "z": h2["z"] || 0 });
    h2 = f2["inverse"](h2);
    if (!h2) return;
  }
  f2["from_greenwich"] && (h2["x"] += f2["from_greenwich"]);
  h2 = a$6(f2["datum"], g2["datum"], h2);
  if (!h2) return;
  g2["from_greenwich"] && (h2 = { "x": h2["x"] - g2["from_greenwich"], "y": h2["y"], "z": h2["z"] || 0 });
  g2["projName"] === "longlat" ? h2 = { "x": h2["x"] * R2D, "y": h2["y"] * R2D, "z": h2["z"] || 0 } : (h2 = g2["forward"](h2), g2["to_meter"] && (h2 = { "x": h2["x"] / g2["to_meter"], "y": h2["y"] / g2["to_meter"], "z": h2["z"] || 0 }));
  if (i2 && g2["axis"] !== "enu") return b$8(g2, !![], h2);
  return h2 && !k2 && delete h2["z"], h2;
}
var wgs84 = Projection("WGS84");
function transformer(c2, d2, e2, f2) {
  var g2, h2, i2;
  if (Array["isArray"](e2)) return g2 = transform(c2, d2, e2, f2) || { "x": NaN, "y": NaN }, e2["length"] > 2 ? typeof c2["name"] !== "undefined" && c2["name"] === "geocent" || typeof d2["name"] !== "undefined" && d2["name"] === "geocent" ? typeof g2["z"] === "number" ? [g2["x"], g2["y"], g2["z"]]["concat"](e2["slice"](3)) : [g2["x"], g2["y"], e2[2]]["concat"](e2["slice"](3)) : [g2["x"], g2["y"]]["concat"](e2["slice"](2)) : [g2["x"], g2["y"]];
  else {
    h2 = transform(c2, d2, e2, f2), i2 = Object["keys"](e2);
    if (i2["length"] === 2) return h2;
    return i2["forEach"](function(j2) {
      if (typeof c2["name"] !== "undefined" && c2["name"] === "geocent" || typeof d2["name"] !== "undefined" && d2["name"] === "geocent") {
        if (j2 === "x" || j2 === "y" || j2 === "z") return;
      } else {
        if (j2 === "x" || j2 === "y") return;
      }
      h2[j2] = e2[j2];
    }), h2;
  }
}
function checkProj(c2) {
  if (c2 instanceof Projection) return c2;
  if (c2["oProj"]) return c2["oProj"];
  return Projection(c2);
}
function proj4(c2, d2, e2) {
  c2 = checkProj(c2);
  var f2 = ![], g2;
  if (typeof d2 === "undefined") d2 = c2, c2 = wgs84, f2 = !![];
  else (typeof d2["x"] !== "undefined" || Array["isArray"](d2)) && (e2 = d2, d2 = c2, c2 = wgs84, f2 = !![]);
  return d2 = checkProj(d2), e2 ? transformer(c2, d2, e2) : (g2 = { "forward": function(h2, i2) {
    return transformer(c2, d2, h2, i2);
  }, "inverse": function(h2, i2) {
    return transformer(d2, c2, h2, i2);
  } }, f2 && (g2["oProj"] = d2), g2);
}
var NUM_100K_SETS = 6, SET_ORIGIN_COLUMN_LETTERS = "AJSAJS", SET_ORIGIN_ROW_LETTERS = "AFAFAF", A$1 = 65, I = 73, O = 79, V = 86, Z = 90;
const h$1 = { "forward": forward$u, "inverse": inverse$u, "toPoint": toPoint };
function forward$u(a2, b2) {
  return b2 = b2 || 5, encode(LLtoUTM({ "lat": a2[1], "lon": a2[0] }), b2);
}
function inverse$u(a2) {
  var b2 = UTMtoLL(decode(a2["toUpperCase"]()));
  if (b2["lat"] && b2["lon"]) return [b2["lon"], b2["lat"], b2["lon"], b2["lat"]];
  return [b2["left"], b2["bottom"], b2["right"], b2["top"]];
}
function toPoint(a2) {
  var b2 = UTMtoLL(decode(a2["toUpperCase"]()));
  if (b2["lat"] && b2["lon"]) return [b2["lon"], b2["lat"]];
  return [(b2["left"] + b2["right"]) / 2, (b2["top"] + b2["bottom"]) / 2];
}
function degToRad(a2) {
  return a2 * (Math["PI"] / 180);
}
function radToDeg(a2) {
  return 180 * (a2 / Math["PI"]);
}
function LLtoUTM(b2) {
  var c2 = b2["lat"], d2 = b2["lon"], e2 = 6378137, f2 = 669438e-8, g2 = 0.9996, h2, i2, j2, k2, l2, m2, n2, o2 = degToRad(c2), p2 = degToRad(d2), q2, r2;
  r2 = Math["floor"]((d2 + 180) / 6) + 1;
  d2 === 180 && (r2 = 60);
  c2 >= 56 && c2 < 64 && d2 >= 3 && d2 < 12 && (r2 = 32);
  if (c2 >= 72 && c2 < 84) {
    if (d2 >= 0 && d2 < 9) r2 = 31;
    else {
      if (d2 >= 9 && d2 < 21) r2 = 33;
      else {
        if (d2 >= 21 && d2 < 33) r2 = 35;
        else d2 >= 33 && d2 < 42 && (r2 = 37);
      }
    }
  }
  h2 = (r2 - 1) * 6 - 180 + 3, q2 = degToRad(h2), i2 = f2 / (1 - f2), j2 = e2 / Math["sqrt"](1 - f2 * Math["sin"](o2) * Math["sin"](o2)), k2 = Math["tan"](o2) * Math["tan"](o2), l2 = i2 * Math["cos"](o2) * Math["cos"](o2), m2 = Math["cos"](o2) * (p2 - q2), n2 = e2 * ((1 - f2 / 4 - 3 * f2 * f2 / 64 - 5 * f2 * f2 * f2 / 256) * o2 - (3 * f2 / 8 + 3 * f2 * f2 / 32 + 45 * f2 * f2 * f2 / 1024) * Math["sin"](2 * o2) + (15 * f2 * f2 / 256 + 45 * f2 * f2 * f2 / 1024) * Math["sin"](4 * o2) - 35 * f2 * f2 * f2 / 3072 * Math["sin"](6 * o2));
  var s2 = g2 * j2 * (m2 + (1 - k2 + l2) * m2 * m2 * m2 / 6 + (5 - 18 * k2 + k2 * k2 + 72 * l2 - 58 * i2) * m2 * m2 * m2 * m2 * m2 / 120) + 5e5, t2 = g2 * (n2 + j2 * Math["tan"](o2) * (m2 * m2 / 2 + (5 - k2 + 9 * l2 + 4 * l2 * l2) * m2 * m2 * m2 * m2 / 24 + (61 - 58 * k2 + k2 * k2 + 600 * l2 - 330 * i2) * m2 * m2 * m2 * m2 * m2 * m2 / 720));
  return c2 < 0 && (t2 += 1e7), { "northing": Math["round"](t2), "easting": Math["round"](s2), "zoneNumber": r2, "zoneLetter": getLetterDesignator(c2) };
}
function UTMtoLL(b2) {
  var c2 = b2["northing"], d2 = b2["easting"], e2 = b2["zoneLetter"], f2 = b2["zoneNumber"];
  if (f2 < 0 || f2 > 60) return null;
  var g2 = 0.9996, h2 = 6378137, i2 = 669438e-8, j2, k2 = (1 - Math["sqrt"](1 - i2)) / (1 + Math["sqrt"](1 - i2)), l2, m2, n2, o2, p2, q2, r2, s2, t2, u2 = d2 - 5e5, v2 = c2;
  e2 < "N" && (v2 -= 1e7);
  r2 = (f2 - 1) * 6 - 180 + 3, j2 = i2 / (1 - i2), q2 = v2 / g2, s2 = q2 / (h2 * (1 - i2 / 4 - 3 * i2 * i2 / 64 - 5 * i2 * i2 * i2 / 256)), t2 = s2 + (3 * k2 / 2 - 27 * k2 * k2 * k2 / 32) * Math["sin"](2 * s2) + (21 * k2 * k2 / 16 - 55 * k2 * k2 * k2 * k2 / 32) * Math["sin"](4 * s2) + 151 * k2 * k2 * k2 / 96 * Math["sin"](6 * s2), l2 = h2 / Math["sqrt"](1 - i2 * Math["sin"](t2) * Math["sin"](t2)), m2 = Math["tan"](t2) * Math["tan"](t2), n2 = j2 * Math["cos"](t2) * Math["cos"](t2), o2 = h2 * (1 - i2) / Math["pow"](1 - i2 * Math["sin"](t2) * Math["sin"](t2), 1.5), p2 = u2 / (l2 * g2);
  var w2 = t2 - l2 * Math["tan"](t2) / o2 * (p2 * p2 / 2 - (5 + 3 * m2 + 10 * n2 - 4 * n2 * n2 - 9 * j2) * p2 * p2 * p2 * p2 / 24 + (61 + 90 * m2 + 298 * n2 + 45 * m2 * m2 - 252 * j2 - 3 * n2 * n2) * p2 * p2 * p2 * p2 * p2 * p2 / 720);
  w2 = radToDeg(w2);
  var z2 = (p2 - (1 + 2 * m2 + n2) * p2 * p2 * p2 / 6 + (5 - 2 * n2 + 28 * m2 - 3 * n2 * n2 + 8 * j2 + 24 * m2 * m2) * p2 * p2 * p2 * p2 * p2 / 120) / Math["cos"](t2);
  z2 = r2 + radToDeg(z2);
  var B2;
  if (b2["accuracy"]) {
    var C2 = UTMtoLL({ "northing": b2["northing"] + b2["accuracy"], "easting": b2["easting"] + b2["accuracy"], "zoneLetter": b2["zoneLetter"], "zoneNumber": b2["zoneNumber"] });
    B2 = { "top": C2["lat"], "right": C2["lon"], "bottom": w2, "left": z2 };
  } else B2 = { "lat": w2, "lon": z2 };
  return B2;
}
function getLetterDesignator(a2) {
  var b2 = "Z";
  if (84 >= a2 && a2 >= 72) b2 = "X";
  else {
    if (72 > a2 && a2 >= 64) b2 = "W";
    else {
      if (64 > a2 && a2 >= 56) b2 = "V";
      else {
        if (56 > a2 && a2 >= 48) b2 = "U";
        else {
          if (48 > a2 && a2 >= 40) b2 = "T";
          else {
            if (40 > a2 && a2 >= 32) b2 = "S";
            else {
              if (32 > a2 && a2 >= 24) b2 = "R";
              else {
                if (24 > a2 && a2 >= 16) b2 = "Q";
                else {
                  if (16 > a2 && a2 >= 8) b2 = "P";
                  else {
                    if (8 > a2 && a2 >= 0) b2 = "N";
                    else {
                      if (0 > a2 && a2 >= -8) b2 = "M";
                      else {
                        if (-8 > a2 && a2 >= -16) b2 = "L";
                        else {
                          if (-16 > a2 && a2 >= -24) b2 = "K";
                          else {
                            if (-24 > a2 && a2 >= -32) b2 = "J";
                            else {
                              if (-32 > a2 && a2 >= -40) b2 = "H";
                              else {
                                if (-40 > a2 && a2 >= -48) b2 = "G";
                                else {
                                  if (-48 > a2 && a2 >= -56) b2 = "F";
                                  else {
                                    if (-56 > a2 && a2 >= -64) b2 = "E";
                                    else {
                                      if (-64 > a2 && a2 >= -72) b2 = "D";
                                      else -72 > a2 && a2 >= -80 && (b2 = "C");
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return b2;
}
function encode(a2, b2) {
  var c2 = "00000" + a2["easting"], d2 = "00000" + a2["northing"];
  return a2["zoneNumber"] + a2["zoneLetter"] + get100kID(a2["easting"], a2["northing"], a2["zoneNumber"]) + c2["substr"](c2["length"] - 5, b2) + d2["substr"](d2["length"] - 5, b2);
}
function get100kID(a2, b2, c2) {
  var d2 = get100kSetForZone(c2), e2 = Math["floor"](a2 / 1e5), f2 = Math["floor"](b2 / 1e5) % 20;
  return getLetter100kID(e2, f2, d2);
}
function get100kSetForZone(a2) {
  var b2 = a2 % NUM_100K_SETS;
  return b2 === 0 && (b2 = NUM_100K_SETS), b2;
}
function getLetter100kID(a2, b2, c2) {
  var d2 = c2 - 1, e2 = SET_ORIGIN_COLUMN_LETTERS["charCodeAt"](d2), f2 = SET_ORIGIN_ROW_LETTERS["charCodeAt"](d2), g2 = e2 + a2 - 1, h2 = f2 + b2, i2 = ![];
  g2 > Z && (g2 = g2 - Z + A$1 - 1, i2 = !![]);
  (g2 === I || e2 < I && g2 > I || (g2 > I || e2 < I) && i2) && g2++;
  (g2 === O || e2 < O && g2 > O || (g2 > O || e2 < O) && i2) && (g2++, g2 === I && g2++);
  g2 > Z && (g2 = g2 - Z + A$1 - 1);
  h2 > V ? (h2 = h2 - V + A$1 - 1, i2 = !![]) : i2 = ![];
  (h2 === I || f2 < I && h2 > I || (h2 > I || f2 < I) && i2) && h2++;
  (h2 === O || f2 < O && h2 > O || (h2 > O || f2 < O) && i2) && (h2++, h2 === I && h2++);
  h2 > V && (h2 = h2 - V + A$1 - 1);
  var j2 = String["fromCharCode"](g2) + String["fromCharCode"](h2);
  return j2;
}
function decode(a2) {
  if (a2 && a2["length"] === 0) throw "MGRSPoint coverting from nothing";
  var b2 = a2["length"], c2 = null, d2 = "", e2, f2 = 0;
  while (!/[A-Z]/["test"](e2 = a2["charAt"](f2))) {
    if (f2 >= 2) throw "MGRSPoint bad conversion from: " + a2;
    d2 += e2, f2++;
  }
  var g2 = parseInt(d2, 10);
  if (f2 === 0 || f2 + 3 > b2) throw "MGRSPoint bad conversion from: " + a2;
  var h2 = a2["charAt"](f2++);
  if (h2 <= "A" || h2 === "B" || h2 === "Y" || h2 >= "Z" || h2 === "I" || h2 === "O") throw "MGRSPoint zone letter " + h2 + " not handled: " + a2;
  c2 = a2["substring"](f2, f2 += 2);
  var j2 = get100kSetForZone(g2), k2 = getEastingFromChar(c2["charAt"](0), j2), l2 = getNorthingFromChar(c2["charAt"](1), j2);
  while (l2 < getMinNorthing(h2)) {
    l2 += 2e6;
  }
  var m2 = b2 - f2;
  if (m2 % 2 !== 0) throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + a2;
  var n2 = m2 / 2, o2 = 0, p2 = 0, q2, r2, s2, t2, u2;
  return n2 > 0 && (q2 = 1e5 / Math["pow"](10, n2), r2 = a2["substring"](f2, f2 + n2), o2 = parseFloat(r2) * q2, s2 = a2["substring"](f2 + n2), p2 = parseFloat(s2) * q2), t2 = o2 + k2, u2 = p2 + l2, { "easting": t2, "northing": u2, "zoneLetter": h2, "zoneNumber": g2, "accuracy": q2 };
}
function getEastingFromChar(a2, b2) {
  var c2 = SET_ORIGIN_COLUMN_LETTERS["charCodeAt"](b2 - 1), d2 = 1e5, f2 = ![];
  while (c2 !== a2["charCodeAt"](0)) {
    c2++;
    c2 === I && c2++;
    c2 === O && c2++;
    if (c2 > Z) {
      if (f2) throw "Bad character: " + a2;
      c2 = A$1, f2 = !![];
    }
    d2 += 1e5;
  }
  return d2;
}
function getNorthingFromChar(a2, b2) {
  if (a2 > "V") throw "MGRSPoint given invalid Northing " + a2;
  var c2 = SET_ORIGIN_ROW_LETTERS["charCodeAt"](b2 - 1), d2 = 0, e2 = ![];
  while (c2 !== a2["charCodeAt"](0)) {
    c2++;
    c2 === I && c2++;
    c2 === O && c2++;
    if (c2 > V) {
      if (e2) throw "Bad character: " + a2;
      c2 = A$1, e2 = !![];
    }
    d2 += 1e5;
  }
  return d2;
}
function getMinNorthing(a2) {
  var b2;
  switch (a2) {
    case "C":
      b2 = 11e5;
      break;
    case "D":
      b2 = 2e6;
      break;
    case "E":
      b2 = 28e5;
      break;
    case "F":
      b2 = 37e5;
      break;
    case "G":
      b2 = 46e5;
      break;
    case "H":
      b2 = 55e5;
      break;
    case "J":
      b2 = 64e5;
      break;
    case "K":
      b2 = 73e5;
      break;
    case "L":
      b2 = 82e5;
      break;
    case "M":
      b2 = 91e5;
      break;
    case "N":
      b2 = 0;
      break;
    case "P":
      b2 = 8e5;
      break;
    case "Q":
      b2 = 17e5;
      break;
    case "R":
      b2 = 26e5;
      break;
    case "S":
      b2 = 35e5;
      break;
    case "T":
      b2 = 44e5;
      break;
    case "U":
      b2 = 53e5;
      break;
    case "V":
      b2 = 62e5;
      break;
    case "W":
      b2 = 7e6;
      break;
    case "X":
      b2 = 79e5;
      break;
    default:
      b2 = -1;
  }
  if (b2 >= 0) return b2;
  else throw "Invalid zone letter: " + a2;
}
function Point(a2, b2, c2) {
  if (!(this instanceof Point)) return new Point(a2, b2, c2);
  if (Array["isArray"](a2)) this["x"] = a2[0], this["y"] = a2[1], this["z"] = a2[2] || 0;
  else {
    if (typeof a2 === "object") this["x"] = a2["x"], this["y"] = a2["y"], this["z"] = a2["z"] || 0;
    else {
      if (typeof a2 === "string" && typeof b2 === "undefined") {
        var d2 = a2["split"](",");
        this["x"] = parseFloat(d2[0], 10), this["y"] = parseFloat(d2[1], 10), this["z"] = parseFloat(d2[2], 10) || 0;
      } else this["x"] = a2, this["y"] = b2, this["z"] = c2 || 0;
    }
  }
  console["warn"]("proj4.Point will be removed in version 3, use proj4.toPoint");
}
Point["fromMGRS"] = function(a2) {
  return new Point(toPoint(a2));
}, Point["prototype"]["toMGRS"] = function(a2) {
  return forward$u([this["x"], this["y"]], a2);
};
var C00 = 1, C02 = 0.25, C04 = 0.046875, C06 = 0.01953125, C08 = 0.01068115234375, C22 = 0.75, C44 = 0.46875, C46 = 0.013020833333333334, C48 = 0.007120768229166667, C66 = 0.3645833333333333, C68 = 0.005696614583333333, C88 = 0.3076171875;
function d$4(es) {
  var en = [];
  en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08))), en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
  var t2 = es * es;
  return en[2] = t2 * (C44 - es * (C46 + es * C48)), t2 *= es, en[3] = t2 * (C66 - es * C68), en[4] = t2 * es * C88, en;
}
function f$3(phi, sphi, cphi, en) {
  return cphi *= sphi, sphi *= sphi, en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
}
var MAX_ITER$3 = 20;
function e$3(arg, es, en) {
  var k2 = 1 / (1 - es), phi = arg;
  for (var i2 = MAX_ITER$3; i2; --i2) {
    var s2 = Math["sin"](phi), t2 = 1 - es * s2 * s2;
    t2 = (f$3(phi, s2, Math["cos"](phi), en) - arg) * (t2 * Math["sqrt"](t2)) * k2, phi -= t2;
    if (Math["abs"](t2) < EPSLN) return phi;
  }
  return phi;
}
function init$v() {
  this["x0"] = this["x0"] !== void 0 ? this["x0"] : 0, this["y0"] = this["y0"] !== void 0 ? this["y0"] : 0, this["long0"] = this["long0"] !== void 0 ? this["long0"] : 0, this["lat0"] = this["lat0"] !== void 0 ? this["lat0"] : 0, this["es"] && (this["en"] = d$4(this["es"]), this["ml0"] = f$3(this["lat0"], Math["sin"](this["lat0"]), Math["cos"](this["lat0"]), this["en"]));
}
function forward$t(f2) {
  var g2 = f2["x"], h2 = f2["y"], i2 = b$b(g2 - this["long0"]), j2, k2, l2, m2 = Math["sin"](h2), n2 = Math["cos"](h2);
  if (!this["es"]) {
    var o2 = n2 * Math["sin"](i2);
    if (Math["abs"](Math["abs"](o2) - 1) < EPSLN) return 93;
    else {
      k2 = 0.5 * this["a"] * this["k0"] * Math["log"]((1 + o2) / (1 - o2)) + this["x0"], l2 = n2 * Math["cos"](i2) / Math["sqrt"](1 - Math["pow"](o2, 2)), o2 = Math["abs"](l2);
      if (o2 >= 1) {
        if (o2 - 1 > EPSLN) return 93;
        else l2 = 0;
      } else l2 = Math["acos"](l2);
      h2 < 0 && (l2 = -l2), l2 = this["a"] * this["k0"] * (l2 - this["lat0"]) + this["y0"];
    }
  } else {
    var q2 = n2 * i2, r2 = Math["pow"](q2, 2), s2 = this["ep2"] * Math["pow"](n2, 2), u2 = Math["pow"](s2, 2), v2 = Math["abs"](n2) > EPSLN ? Math["tan"](h2) : 0, w2 = Math["pow"](v2, 2), z2 = Math["pow"](w2, 2);
    j2 = 1 - this["es"] * Math["pow"](m2, 2), q2 = q2 / Math["sqrt"](j2);
    var A5 = f$3(h2, m2, n2, this["en"]);
    k2 = this["a"] * (this["k0"] * q2 * (1 + r2 / 6 * (1 - w2 + s2 + r2 / 20 * (5 - 18 * w2 + z2 + 14 * s2 - 58 * w2 * s2 + r2 / 42 * (61 + 179 * z2 - z2 * w2 - 479 * w2))))) + this["x0"], l2 = this["a"] * (this["k0"] * (A5 - this["ml0"] + m2 * i2 * q2 / 2 * (1 + r2 / 12 * (5 - w2 + 9 * s2 + 4 * u2 + r2 / 30 * (61 + z2 - 58 * w2 + 270 * s2 - 330 * w2 * s2 + r2 / 56 * (1385 + 543 * z2 - z2 * w2 - 3111 * w2)))))) + this["y0"];
  }
  return f2["x"] = k2, f2["y"] = l2, f2;
}
function inverse$t(i2) {
  var j2, k2, l2, m2, n2 = (i2["x"] - this["x0"]) * (1 / this["a"]), o2 = (i2["y"] - this["y0"]) * (1 / this["a"]);
  if (!this["es"]) {
    var q2 = Math["exp"](n2 / this["k0"]), r2 = 0.5 * (q2 - 1 / q2), s2 = this["lat0"] + o2 / this["k0"], u2 = Math["cos"](s2);
    j2 = Math["sqrt"]((1 - Math["pow"](u2, 2)) / (1 + Math["pow"](r2, 2))), l2 = Math["asin"](j2), o2 < 0 && (l2 = -l2), r2 === 0 && u2 === 0 ? m2 = 0 : m2 = b$b(Math["atan2"](r2, u2) + this["long0"]);
  } else {
    j2 = this["ml0"] + o2 / this["k0"], k2 = e$3(j2, this["es"], this["en"]);
    if (Math["abs"](k2) < HALF_PI) {
      var v2 = Math["sin"](k2), w2 = Math["cos"](k2), z2 = Math["abs"](w2) > EPSLN ? Math["tan"](k2) : 0, A5 = this["ep2"] * Math["pow"](w2, 2), B2 = Math["pow"](A5, 2), C2 = Math["pow"](z2, 2), D2 = Math["pow"](C2, 2);
      j2 = 1 - this["es"] * Math["pow"](v2, 2);
      var E2 = n2 * Math["sqrt"](j2) / this["k0"], F = Math["pow"](E2, 2);
      j2 = j2 * z2, l2 = k2 - j2 * F / (1 - this["es"]) * 0.5 * (1 - F / 12 * (5 + 3 * C2 - 9 * A5 * C2 + A5 - 4 * B2 - F / 30 * (61 + 90 * C2 - 252 * A5 * C2 + 45 * D2 + 46 * A5 - F / 56 * (1385 + 3633 * C2 + 4095 * D2 + 1574 * D2 * C2)))), m2 = b$b(this["long0"] + E2 * (1 - F / 6 * (1 + 2 * C2 + A5 - F / 20 * (5 + 28 * C2 + 24 * D2 + 8 * A5 * C2 + 6 * A5 - F / 42 * (61 + 662 * C2 + 1320 * D2 + 720 * D2 * C2)))) / w2);
    } else l2 = HALF_PI * a$8(o2), m2 = 0;
  }
  return i2["x"] = m2, i2["y"] = l2, i2;
}
var names$v = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
const a$5 = { "init": init$v, "forward": forward$t, "inverse": inverse$t, "names": names$v };
function b$7(x2) {
  var r2 = Math["exp"](x2);
  return r2 = (r2 - 1 / r2) / 2, r2;
}
function c$2(x2, y2) {
  x2 = Math["abs"](x2), y2 = Math["abs"](y2);
  var a2 = Math["max"](x2, y2), b2 = Math["min"](x2, y2) / (a2 ? a2 : 1);
  return a2 * Math["sqrt"](1 + Math["pow"](b2, 2));
}
function b$6(x2) {
  var y2 = 1 + x2, z2 = y2 - 1;
  return z2 === 0 ? x2 : x2 * Math["log"](y2) / z2;
}
function d$3(x2) {
  var y2 = Math["abs"](x2);
  return y2 = b$6(y2 * (1 + y2 / (c$2(1, y2) + 1))), x2 < 0 ? -y2 : y2;
}
function e$2(pp, B2) {
  var cos_2B = 2 * Math["cos"](2 * B2), i2 = pp["length"] - 1, h1 = pp[i2], h2 = 0, h3;
  while (--i2 >= 0) {
    h3 = -h2 + cos_2B * h1 + pp[i2], h2 = h1, h1 = h3;
  }
  return B2 + h3 * Math["sin"](2 * B2);
}
function f$2(pp, arg_r) {
  var r2 = 2 * Math["cos"](arg_r), i2 = pp["length"] - 1, hr1 = pp[i2], hr2 = 0, hr;
  while (--i2 >= 0) {
    hr = -hr2 + r2 * hr1 + pp[i2], hr2 = hr1, hr1 = hr;
  }
  return Math["sin"](arg_r) * hr;
}
function b$5(x2) {
  var r2 = Math["exp"](x2);
  return r2 = (r2 + 1 / r2) / 2, r2;
}
function g$2(pp, arg_r, arg_i) {
  var sin_arg_r = Math["sin"](arg_r), cos_arg_r = Math["cos"](arg_r), sinh_arg_i = b$7(arg_i), cosh_arg_i = b$5(arg_i), r2 = 2 * cos_arg_r * cosh_arg_i, i2 = -2 * sin_arg_r * sinh_arg_i, j2 = pp["length"] - 1, hr = pp[j2], hi1 = 0, hr1 = 0, hi = 0, hr2, hi2;
  while (--j2 >= 0) {
    hr2 = hr1, hi2 = hi1, hr1 = hr, hi1 = hi, hr = -hr2 + r2 * hr1 - i2 * hi1 + pp[j2], hi = -hi2 + i2 * hr1 + r2 * hi1;
  }
  return r2 = sin_arg_r * cosh_arg_i, i2 = cos_arg_r * sinh_arg_i, [r2 * hr - i2 * hi, r2 * hi + i2 * hr];
}
function init$u() {
  if (!this["approx"] && (isNaN(this["es"]) || this["es"] <= 0)) throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
  this["approx"] && (a$5["init"]["apply"](this), this["forward"] = a$5["forward"], this["inverse"] = a$5["inverse"]);
  this["x0"] = this["x0"] !== void 0 ? this["x0"] : 0, this["y0"] = this["y0"] !== void 0 ? this["y0"] : 0, this["long0"] = this["long0"] !== void 0 ? this["long0"] : 0, this["lat0"] = this["lat0"] !== void 0 ? this["lat0"] : 0, this["cgb"] = [], this["cbg"] = [], this["utg"] = [], this["gtu"] = [];
  var i2 = this["es"] / (1 + Math["sqrt"](1 - this["es"])), j2 = i2 / (2 - i2), k2 = j2;
  this["cgb"][0] = j2 * (2 + j2 * (-2 / 3 + j2 * (-2 + j2 * (116 / 45 + j2 * (26 / 45 + j2 * (-2854 / 675)))))), this["cbg"][0] = j2 * (-2 + j2 * (2 / 3 + j2 * (4 / 3 + j2 * (-82 / 45 + j2 * (32 / 45 + j2 * (4642 / 4725)))))), k2 = k2 * j2, this["cgb"][1] = k2 * (7 / 3 + j2 * (-8 / 5 + j2 * (-227 / 45 + j2 * (2704 / 315 + j2 * (2323 / 945))))), this["cbg"][1] = k2 * (5 / 3 + j2 * (-16 / 15 + j2 * (-13 / 9 + j2 * (904 / 315 + j2 * (-1522 / 945))))), k2 = k2 * j2, this["cgb"][2] = k2 * (56 / 15 + j2 * (-136 / 35 + j2 * (-1262 / 105 + j2 * (73814 / 2835)))), this["cbg"][2] = k2 * (-26 / 15 + j2 * (34 / 21 + j2 * (8 / 5 + j2 * (-12686 / 2835)))), k2 = k2 * j2, this["cgb"][3] = k2 * (4279 / 630 + j2 * (-332 / 35 + j2 * (-399572 / 14175))), this["cbg"][3] = k2 * (1237 / 630 + j2 * (-12 / 5 + j2 * (-24832 / 14175))), k2 = k2 * j2, this["cgb"][4] = k2 * (4174 / 315 + j2 * (-144838 / 6237)), this["cbg"][4] = k2 * (-734 / 315 + j2 * (109598 / 31185)), k2 = k2 * j2, this["cgb"][5] = k2 * (601676 / 22275), this["cbg"][5] = k2 * (444337 / 155925), k2 = Math["pow"](j2, 2), this["Qn"] = this["k0"] / (1 + j2) * (1 + k2 * (1 / 4 + k2 * (1 / 64 + k2 / 256))), this["utg"][0] = j2 * (-0.5 + j2 * (2 / 3 + j2 * (-37 / 96 + j2 * (1 / 360 + j2 * (81 / 512 + j2 * (-96199 / 604800)))))), this["gtu"][0] = j2 * (0.5 + j2 * (-2 / 3 + j2 * (5 / 16 + j2 * (41 / 180 + j2 * (-127 / 288 + j2 * (7891 / 37800)))))), this["utg"][1] = k2 * (-1 / 48 + j2 * (-1 / 15 + j2 * (437 / 1440 + j2 * (-46 / 105 + j2 * (1118711 / 3870720))))), this["gtu"][1] = k2 * (13 / 48 + j2 * (-3 / 5 + j2 * (557 / 1440 + j2 * (281 / 630 + j2 * (-1983433 / 1935360))))), k2 = k2 * j2, this["utg"][2] = k2 * (-17 / 480 + j2 * (37 / 840 + j2 * (209 / 4480 + j2 * (-5569 / 90720)))), this["gtu"][2] = k2 * (61 / 240 + j2 * (-103 / 140 + j2 * (15061 / 26880 + j2 * (167603 / 181440)))), k2 = k2 * j2, this["utg"][3] = k2 * (-4397 / 161280 + j2 * (11 / 504 + j2 * (830251 / 7257600))), this["gtu"][3] = k2 * (49561 / 161280 + j2 * (-179 / 168 + j2 * (6601661 / 7257600))), k2 = k2 * j2, this["utg"][4] = k2 * (-4583 / 161280 + j2 * (108847 / 3991680)), this["gtu"][4] = k2 * (34729 / 80640 + j2 * (-3418889 / 1995840)), k2 = k2 * j2, this["utg"][5] = k2 * (-20648693 / 638668800), this["gtu"][5] = k2 * (212378941 / 319334400);
  var l2 = e$2(this["cbg"], this["lat0"]);
  this["Zb"] = -this["Qn"] * (l2 + f$2(this["gtu"], 2 * l2));
}
function forward$s(i2) {
  var j2 = b$b(i2["x"] - this["long0"]), k2 = i2["y"];
  k2 = e$2(this["cbg"], k2);
  var l2 = Math["sin"](k2), m2 = Math["cos"](k2), n2 = Math["sin"](j2), o2 = Math["cos"](j2);
  k2 = Math["atan2"](l2, o2 * m2), j2 = Math["atan2"](n2 * m2, c$2(l2, m2 * o2)), j2 = d$3(Math["tan"](j2));
  var q2 = g$2(this["gtu"], 2 * k2, 2 * j2);
  k2 = k2 + q2[0], j2 = j2 + q2[1];
  var r2, s2;
  return Math["abs"](j2) <= 2.623395162778 ? (r2 = this["a"] * (this["Qn"] * j2) + this["x0"], s2 = this["a"] * (this["Qn"] * k2 + this["Zb"]) + this["y0"]) : (r2 = Infinity, s2 = Infinity), i2["x"] = r2, i2["y"] = s2, i2;
}
function inverse$s(i2) {
  var j2 = (i2["x"] - this["x0"]) * (1 / this["a"]), k2 = (i2["y"] - this["y0"]) * (1 / this["a"]);
  k2 = (k2 - this["Zb"]) / this["Qn"], j2 = j2 / this["Qn"];
  var l2, m2;
  if (Math["abs"](j2) <= 2.623395162778) {
    var n2 = g$2(this["utg"], 2 * k2, 2 * j2);
    k2 = k2 + n2[0], j2 = j2 + n2[1], j2 = Math["atan"](b$7(j2));
    var o2 = Math["sin"](k2), q2 = Math["cos"](k2), r2 = Math["sin"](j2), s2 = Math["cos"](j2);
    k2 = Math["atan2"](o2 * s2, c$2(r2, s2 * q2)), j2 = Math["atan2"](r2, s2 * q2), l2 = b$b(j2 + this["long0"]), m2 = e$2(this["cgb"], k2);
  } else l2 = Infinity, m2 = Infinity;
  return i2["x"] = l2, i2["y"] = m2, i2;
}
var names$u = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"];
const b$4 = { "init": init$u, "forward": forward$s, "inverse": inverse$s, "names": names$u };
function a$4(zone, lon) {
  if (zone === void 0) {
    zone = Math["floor"]((b$b(lon) + Math["PI"]) * 30 / Math["PI"]) + 1;
    if (zone < 0) return 0;
    else {
      if (zone > 60) return 60;
    }
  }
  return zone;
}
var dependsOn = "etmerc";
function init$t() {
  var c2 = a$4(this["zone"], this["long0"]);
  if (c2 === void 0) throw new Error("unknown utm zone");
  this["lat0"] = 0, this["long0"] = (6 * Math["abs"](c2) - 183) * D2R$1, this["x0"] = 5e5, this["y0"] = this["utmSouth"] ? 1e7 : 0, this["k0"] = 0.9996, b$4["init"]["apply"](this), this["forward"] = b$4["forward"], this["inverse"] = b$4["inverse"];
}
var names$t = ["Universal Transverse Mercator System", "utm"];
const c$1 = { "init": init$t, "names": names$t, "dependsOn": dependsOn };
function a$3(esinp, exp) {
  return Math["pow"]((1 - esinp) / (1 + esinp), exp);
}
var MAX_ITER$2 = 20;
function init$s() {
  var b2 = Math["sin"](this["lat0"]), c2 = Math["cos"](this["lat0"]);
  c2 *= c2, this["rc"] = Math["sqrt"](1 - this["es"]) / (1 - this["es"] * b2 * b2), this["C"] = Math["sqrt"](1 + this["es"] * c2 * c2 / (1 - this["es"])), this["phic0"] = Math["asin"](b2 / this["C"]), this["ratexp"] = 0.5 * this["C"] * this["e"], this["K"] = Math["tan"](0.5 * this["phic0"] + FORTPI) / (Math["pow"](Math["tan"](0.5 * this["lat0"] + FORTPI), this["C"]) * a$3(this["e"] * b2, this["ratexp"]));
}
function forward$r(b2) {
  var c2 = b2["x"], d2 = b2["y"];
  return b2["y"] = 2 * Math["atan"](this["K"] * Math["pow"](Math["tan"](0.5 * d2 + FORTPI), this["C"]) * a$3(this["e"] * Math["sin"](d2), this["ratexp"])) - HALF_PI, b2["x"] = this["C"] * c2, b2;
}
function inverse$r(b2) {
  var c2 = 1e-14, d2 = b2["x"] / this["C"], e2 = b2["y"], f2 = Math["pow"](Math["tan"](0.5 * e2 + FORTPI) / this["K"], 1 / this["C"]);
  for (var g2 = MAX_ITER$2; g2 > 0; --g2) {
    e2 = 2 * Math["atan"](f2 * a$3(this["e"] * Math["sin"](b2["y"]), -0.5 * this["e"])) - HALF_PI;
    if (Math["abs"](e2 - b2["y"]) < c2) break;
    b2["y"] = e2;
  }
  if (!g2) return null;
  return b2["x"] = d2, b2["y"] = e2, b2;
}
var names$s = ["gauss"];
const a$2 = { "init": init$s, "forward": forward$r, "inverse": inverse$r, "names": names$s };
function init$r() {
  a$2["init"]["apply"](this);
  if (!this["rc"]) return;
  this["sinc0"] = Math["sin"](this["phic0"]), this["cosc0"] = Math["cos"](this["phic0"]), this["R2"] = 2 * this["rc"], !this["title"] && (this["title"] = "Oblique Stereographic Alternative");
}
function forward$q(d2) {
  var e2, f2, g2, h2;
  return d2["x"] = b$b(d2["x"] - this["long0"]), a$2["forward"]["apply"](this, [d2]), e2 = Math["sin"](d2["y"]), f2 = Math["cos"](d2["y"]), g2 = Math["cos"](d2["x"]), h2 = this["k0"] * this["R2"] / (1 + this["sinc0"] * e2 + this["cosc0"] * f2 * g2), d2["x"] = h2 * f2 * Math["sin"](d2["x"]), d2["y"] = h2 * (this["cosc0"] * e2 - this["sinc0"] * f2 * g2), d2["x"] = this["a"] * d2["x"] + this["x0"], d2["y"] = this["a"] * d2["y"] + this["y0"], d2;
}
function inverse$q(d2) {
  var e2, f2, g2, h2, i2;
  d2["x"] = (d2["x"] - this["x0"]) / this["a"], d2["y"] = (d2["y"] - this["y0"]) / this["a"], d2["x"] /= this["k0"], d2["y"] /= this["k0"];
  if (i2 = c$2(d2["x"], d2["y"])) {
    var j2 = 2 * Math["atan2"](i2, this["R2"]);
    e2 = Math["sin"](j2), f2 = Math["cos"](j2), h2 = Math["asin"](f2 * this["sinc0"] + d2["y"] * e2 * this["cosc0"] / i2), g2 = Math["atan2"](d2["x"] * e2, i2 * this["cosc0"] * f2 - d2["y"] * this["sinc0"] * e2);
  } else h2 = this["phic0"], g2 = 0;
  return d2["x"] = g2, d2["y"] = h2, a$2["inverse"]["apply"](this, [d2]), d2["x"] = b$b(d2["x"] + this["long0"]), d2;
}
var names$r = ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
const d$2 = { "init": init$r, "forward": forward$q, "inverse": inverse$q, "names": names$r };
function ssfn_(f2, g2, h2) {
  return g2 *= h2, Math["tan"](0.5 * (HALF_PI + f2)) * Math["pow"]((1 - g2) / (1 + g2), 0.5 * h2);
}
function init$q() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["lat0"] = this["lat0"] || 0, this["long0"] = this["long0"] || 0, this["coslat0"] = Math["cos"](this["lat0"]), this["sinlat0"] = Math["sin"](this["lat0"]), this["sphere"] ? this["k0"] === 1 && !isNaN(this["lat_ts"]) && Math["abs"](this["coslat0"]) <= EPSLN && (this["k0"] = 0.5 * (1 + a$8(this["lat0"]) * Math["sin"](this["lat_ts"]))) : (Math["abs"](this["coslat0"]) <= EPSLN && (this["lat0"] > 0 ? this["con"] = 1 : this["con"] = -1), this["cons"] = Math["sqrt"](Math["pow"](1 + this["e"], 1 + this["e"]) * Math["pow"](1 - this["e"], 1 - this["e"])), this["k0"] === 1 && !isNaN(this["lat_ts"]) && Math["abs"](this["coslat0"]) <= EPSLN && Math["abs"](Math["cos"](this["lat_ts"])) > EPSLN && (this["k0"] = 0.5 * this["cons"] * e$6(this["e"], Math["sin"](this["lat_ts"]), Math["cos"](this["lat_ts"])) / b$a(this["e"], this["con"] * this["lat_ts"], this["con"] * Math["sin"](this["lat_ts"]))), this["ms1"] = e$6(this["e"], this["sinlat0"], this["coslat0"]), this["X0"] = 2 * Math["atan"](this["ssfn_"](this["lat0"], this["sinlat0"], this["e"])) - HALF_PI, this["cosX0"] = Math["cos"](this["X0"]), this["sinX0"] = Math["sin"](this["X0"]));
}
function forward$p(f2) {
  var g2 = f2["x"], h2 = f2["y"], i2 = Math["sin"](h2), j2 = Math["cos"](h2), k2, l2, m2, n2, o2, q2, r2 = b$b(g2 - this["long0"]);
  if (Math["abs"](Math["abs"](g2 - this["long0"]) - Math["PI"]) <= EPSLN && Math["abs"](h2 + this["lat0"]) <= EPSLN) return f2["x"] = NaN, f2["y"] = NaN, f2;
  if (this["sphere"]) return k2 = 2 * this["k0"] / (1 + this["sinlat0"] * i2 + this["coslat0"] * j2 * Math["cos"](r2)), f2["x"] = this["a"] * k2 * j2 * Math["sin"](r2) + this["x0"], f2["y"] = this["a"] * k2 * (this["coslat0"] * i2 - this["sinlat0"] * j2 * Math["cos"](r2)) + this["y0"], f2;
  else {
    l2 = 2 * Math["atan"](this["ssfn_"](h2, i2, this["e"])) - HALF_PI, n2 = Math["cos"](l2), m2 = Math["sin"](l2);
    if (Math["abs"](this["coslat0"]) <= EPSLN) return o2 = b$a(this["e"], h2 * this["con"], this["con"] * i2), q2 = 2 * this["a"] * this["k0"] * o2 / this["cons"], f2["x"] = this["x0"] + q2 * Math["sin"](g2 - this["long0"]), f2["y"] = this["y0"] - this["con"] * q2 * Math["cos"](g2 - this["long0"]), f2;
    else Math["abs"](this["sinlat0"]) < EPSLN ? (k2 = 2 * this["a"] * this["k0"] / (1 + n2 * Math["cos"](r2)), f2["y"] = k2 * m2) : (k2 = 2 * this["a"] * this["k0"] * this["ms1"] / (this["cosX0"] * (1 + this["sinX0"] * m2 + this["cosX0"] * n2 * Math["cos"](r2))), f2["y"] = k2 * (this["cosX0"] * m2 - this["sinX0"] * n2 * Math["cos"](r2)) + this["y0"]);
    f2["x"] = k2 * n2 * Math["sin"](r2) + this["x0"];
  }
  return f2;
}
function inverse$p(f2) {
  f2["x"] -= this["x0"], f2["y"] -= this["y0"];
  var g2, h2, i2, j2, k2, l2 = Math["sqrt"](f2["x"] * f2["x"] + f2["y"] * f2["y"]);
  if (this["sphere"]) {
    var m2 = 2 * Math["atan"](l2 / (2 * this["a"] * this["k0"]));
    g2 = this["long0"], h2 = this["lat0"];
    if (l2 <= EPSLN) return f2["x"] = g2, f2["y"] = h2, f2;
    return h2 = Math["asin"](Math["cos"](m2) * this["sinlat0"] + f2["y"] * Math["sin"](m2) * this["coslat0"] / l2), Math["abs"](this["coslat0"]) < EPSLN ? this["lat0"] > 0 ? g2 = b$b(this["long0"] + Math["atan2"](f2["x"], -1 * f2["y"])) : g2 = b$b(this["long0"] + Math["atan2"](f2["x"], f2["y"])) : g2 = b$b(this["long0"] + Math["atan2"](f2["x"] * Math["sin"](m2), l2 * this["coslat0"] * Math["cos"](m2) - f2["y"] * this["sinlat0"] * Math["sin"](m2))), f2["x"] = g2, f2["y"] = h2, f2;
  } else {
    if (Math["abs"](this["coslat0"]) <= EPSLN) {
      if (l2 <= EPSLN) return h2 = this["lat0"], g2 = this["long0"], f2["x"] = g2, f2["y"] = h2, f2;
      f2["x"] *= this["con"], f2["y"] *= this["con"], i2 = l2 * this["cons"] / (2 * this["a"] * this["k0"]), h2 = this["con"] * e$5(this["e"], i2), g2 = this["con"] * b$b(this["con"] * this["long0"] + Math["atan2"](f2["x"], -1 * f2["y"]));
    } else j2 = 2 * Math["atan"](l2 * this["cosX0"] / (2 * this["a"] * this["k0"] * this["ms1"])), g2 = this["long0"], l2 <= EPSLN ? k2 = this["X0"] : (k2 = Math["asin"](Math["cos"](j2) * this["sinX0"] + f2["y"] * Math["sin"](j2) * this["cosX0"] / l2), g2 = b$b(this["long0"] + Math["atan2"](f2["x"] * Math["sin"](j2), l2 * this["cosX0"] * Math["cos"](j2) - f2["y"] * this["sinX0"] * Math["sin"](j2)))), h2 = -1 * e$5(this["e"], Math["tan"](0.5 * (HALF_PI + k2)));
  }
  return f2["x"] = g2, f2["y"] = h2, f2;
}
var names$q = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)", "Polar_Stereographic"];
const e$1 = { "init": init$q, "forward": forward$p, "inverse": inverse$p, "names": names$q, "ssfn_": ssfn_ };
function init$p() {
  var a2 = this["lat0"];
  this["lambda0"] = this["long0"];
  var b2 = Math["sin"](a2), c2 = this["a"], d2 = this["rf"], f2 = 1 / d2, g2 = 2 * f2 - Math["pow"](f2, 2), h2 = this["e"] = Math["sqrt"](g2);
  this["R"] = this["k0"] * c2 * Math["sqrt"](1 - g2) / (1 - g2 * Math["pow"](b2, 2)), this["alpha"] = Math["sqrt"](1 + g2 / (1 - g2) * Math["pow"](Math["cos"](a2), 4)), this["b0"] = Math["asin"](b2 / this["alpha"]);
  var i2 = Math["log"](Math["tan"](Math["PI"] / 4 + this["b0"] / 2)), j2 = Math["log"](Math["tan"](Math["PI"] / 4 + a2 / 2)), k2 = Math["log"]((1 + h2 * b2) / (1 - h2 * b2));
  this["K"] = i2 - this["alpha"] * j2 + this["alpha"] * h2 / 2 * k2;
}
function forward$o(a2) {
  var c2 = Math["log"](Math["tan"](Math["PI"] / 4 - a2["y"] / 2)), d2 = this["e"] / 2 * Math["log"]((1 + this["e"] * Math["sin"](a2["y"])) / (1 - this["e"] * Math["sin"](a2["y"]))), e2 = -this["alpha"] * (c2 + d2) + this["K"], f2 = 2 * (Math["atan"](Math["exp"](e2)) - Math["PI"] / 4), g2 = this["alpha"] * (a2["x"] - this["lambda0"]), h2 = Math["atan"](Math["sin"](g2) / (Math["sin"](this["b0"]) * Math["tan"](f2) + Math["cos"](this["b0"]) * Math["cos"](g2))), i2 = Math["asin"](Math["cos"](this["b0"]) * Math["sin"](f2) - Math["sin"](this["b0"]) * Math["cos"](f2) * Math["cos"](g2));
  return a2["y"] = this["R"] / 2 * Math["log"]((1 + Math["sin"](i2)) / (1 - Math["sin"](i2))) + this["y0"], a2["x"] = this["R"] * h2 + this["x0"], a2;
}
function inverse$o(a2) {
  var c2 = a2["x"] - this["x0"], d2 = a2["y"] - this["y0"], e2 = c2 / this["R"], f2 = 2 * (Math["atan"](Math["exp"](d2 / this["R"])) - Math["PI"] / 4), g2 = Math["asin"](Math["cos"](this["b0"]) * Math["sin"](f2) + Math["sin"](this["b0"]) * Math["cos"](f2) * Math["cos"](e2)), h2 = Math["atan"](Math["sin"](e2) / (Math["cos"](this["b0"]) * Math["cos"](e2) - Math["sin"](this["b0"]) * Math["tan"](f2))), i2 = this["lambda0"] + h2 / this["alpha"], j2 = 0, k2 = g2, l2 = -1e3, m2 = 0;
  while (Math["abs"](k2 - l2) > 1e-7) {
    if (++m2 > 20) return;
    j2 = 1 / this["alpha"] * (Math["log"](Math["tan"](Math["PI"] / 4 + g2 / 2)) - this["K"]) + this["e"] * Math["log"](Math["tan"](Math["PI"] / 4 + Math["asin"](this["e"] * Math["sin"](k2)) / 2)), l2 = k2, k2 = 2 * Math["atan"](Math["exp"](j2)) - Math["PI"] / 2;
  }
  return a2["x"] = i2, a2["y"] = k2, a2;
}
var names$p = ["somerc"];
const f$1 = { "init": init$p, "forward": forward$o, "inverse": inverse$o, "names": names$p };
var TOL = 1e-7;
function isTypeA(d2) {
  var e2 = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], f2 = typeof d2["PROJECTION"] === "object" ? Object["keys"](d2["PROJECTION"])[0] : d2["PROJECTION"];
  return "no_uoff" in d2 || "no_off" in d2 || e2["indexOf"](f2) !== -1;
}
function init$o() {
  var d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2 = 0, o2, q2 = 0, r2 = 0, s2 = 0, t2 = 0, u2 = 0, v2 = 0;
  this["no_off"] = isTypeA(this), this["no_rot"] = "no_rot" in this;
  var x2 = ![];
  "alpha" in this && (x2 = !![]);
  var y2 = ![];
  "rectified_grid_angle" in this && (y2 = !![]);
  x2 && (v2 = this["alpha"]);
  y2 && (n2 = this["rectified_grid_angle"] * D2R$1);
  if (x2 || y2) q2 = this["longc"];
  else {
    r2 = this["long1"], t2 = this["lat1"], s2 = this["long2"], u2 = this["lat2"];
    if (Math["abs"](t2 - u2) <= TOL || (d2 = Math["abs"](t2)) <= TOL || Math["abs"](d2 - HALF_PI) <= TOL || Math["abs"](Math["abs"](this["lat0"]) - HALF_PI) <= TOL || Math["abs"](Math["abs"](u2) - HALF_PI) <= TOL) throw new Error();
  }
  var z2 = 1 - this["es"];
  e2 = Math["sqrt"](z2);
  Math["abs"](this["lat0"]) > EPSLN ? (k2 = Math["sin"](this["lat0"]), f2 = Math["cos"](this["lat0"]), d2 = 1 - this["es"] * k2 * k2, this["B"] = f2 * f2, this["B"] = Math["sqrt"](1 + this["es"] * this["B"] * this["B"] / z2), this["A"] = this["B"] * this["k0"] * e2 / d2, g2 = this["B"] * e2 / (f2 * Math["sqrt"](d2)), h2 = g2 * g2 - 1, h2 <= 0 ? h2 = 0 : (h2 = Math["sqrt"](h2), this["lat0"] < 0 && (h2 = -h2)), this["E"] = h2 += g2, this["E"] *= Math["pow"](b$a(this["e"], this["lat0"], k2), this["B"])) : (this["B"] = 1 / e2, this["A"] = this["k0"], this["E"] = g2 = h2 = 1);
  if (x2 || y2) x2 ? (o2 = Math["asin"](Math["sin"](v2) / g2), !y2 && (n2 = v2)) : (o2 = n2, v2 = Math["asin"](g2 * Math["sin"](o2))), this["lam0"] = q2 - Math["asin"](0.5 * (h2 - 1 / h2) * Math["tan"](o2)) / this["B"];
  else {
    i2 = Math["pow"](b$a(this["e"], t2, Math["sin"](t2)), this["B"]), j2 = Math["pow"](b$a(this["e"], u2, Math["sin"](u2)), this["B"]), h2 = this["E"] / i2, l2 = (j2 - i2) / (j2 + i2), m2 = this["E"] * this["E"], m2 = (m2 - j2 * i2) / (m2 + j2 * i2), d2 = r2 - s2;
    if (d2 < -Math["pi"]) s2 -= TWO_PI;
    else d2 > Math["pi"] && (s2 += TWO_PI);
    this["lam0"] = b$b(0.5 * (r2 + s2) - Math["atan"](m2 * Math["tan"](0.5 * this["B"] * (r2 - s2)) / l2) / this["B"]), o2 = Math["atan"](2 * Math["sin"](this["B"] * b$b(r2 - this["lam0"])) / (h2 - 1 / h2)), n2 = v2 = Math["asin"](g2 * Math["sin"](o2));
  }
  this["singam"] = Math["sin"](o2), this["cosgam"] = Math["cos"](o2), this["sinrot"] = Math["sin"](n2), this["cosrot"] = Math["cos"](n2), this["rB"] = 1 / this["B"], this["ArB"] = this["A"] * this["rB"], this["BrA"] = 1 / this["ArB"], this["A"] * this["B"], this["no_off"] ? this["u_0"] = 0 : (this["u_0"] = Math["abs"](this["ArB"] * Math["atan"](Math["sqrt"](g2 * g2 - 1) / Math["cos"](v2))), this["lat0"] < 0 && (this["u_0"] = -this["u_0"])), h2 = 0.5 * o2, this["v_pole_n"] = this["ArB"] * Math["log"](Math["tan"](FORTPI - h2)), this["v_pole_s"] = this["ArB"] * Math["log"](Math["tan"](FORTPI + h2));
}
function forward$n(d2) {
  var e2 = {}, f2, g2, h2, i2, j2, k2, l2, m2;
  d2["x"] = d2["x"] - this["lam0"];
  if (Math["abs"](Math["abs"](d2["y"]) - HALF_PI) > EPSLN) {
    j2 = this["E"] / Math["pow"](b$a(this["e"], d2["y"], Math["sin"](d2["y"])), this["B"]), k2 = 1 / j2, f2 = 0.5 * (j2 - k2), g2 = 0.5 * (j2 + k2), i2 = Math["sin"](this["B"] * d2["x"]), h2 = (f2 * this["singam"] - i2 * this["cosgam"]) / g2;
    if (Math["abs"](Math["abs"](h2) - 1) < EPSLN) throw new Error();
    m2 = 0.5 * this["ArB"] * Math["log"]((1 - h2) / (1 + h2)), k2 = Math["cos"](this["B"] * d2["x"]), Math["abs"](k2) < TOL ? l2 = this["A"] * d2["x"] : l2 = this["ArB"] * Math["atan2"](f2 * this["cosgam"] + i2 * this["singam"], k2);
  } else m2 = d2["y"] > 0 ? this["v_pole_n"] : this["v_pole_s"], l2 = this["ArB"] * d2["y"];
  return this["no_rot"] ? (e2["x"] = l2, e2["y"] = m2) : (l2 -= this["u_0"], e2["x"] = m2 * this["cosrot"] + l2 * this["sinrot"], e2["y"] = l2 * this["cosrot"] - m2 * this["sinrot"]), e2["x"] = this["a"] * e2["x"] + this["x0"], e2["y"] = this["a"] * e2["y"] + this["y0"], e2;
}
function inverse$n(d2) {
  var e2, f2, g2, h2, i2, j2, k2, l2 = {};
  d2["x"] = (d2["x"] - this["x0"]) * (1 / this["a"]), d2["y"] = (d2["y"] - this["y0"]) * (1 / this["a"]);
  this["no_rot"] ? (f2 = d2["y"], e2 = d2["x"]) : (f2 = d2["x"] * this["cosrot"] - d2["y"] * this["sinrot"], e2 = d2["y"] * this["cosrot"] + d2["x"] * this["sinrot"] + this["u_0"]);
  g2 = Math["exp"](-this["BrA"] * f2), h2 = 0.5 * (g2 - 1 / g2), i2 = 0.5 * (g2 + 1 / g2), j2 = Math["sin"](this["BrA"] * e2), k2 = (j2 * this["cosgam"] + h2 * this["singam"]) / i2;
  if (Math["abs"](Math["abs"](k2) - 1) < EPSLN) l2["x"] = 0, l2["y"] = k2 < 0 ? -HALF_PI : HALF_PI;
  else {
    l2["y"] = this["E"] / Math["sqrt"]((1 + k2) / (1 - k2)), l2["y"] = e$5(this["e"], Math["pow"](l2["y"], 1 / this["B"]));
    if (l2["y"] === Infinity) throw new Error();
    l2["x"] = -this["rB"] * Math["atan2"](h2 * this["cosgam"] - j2 * this["singam"], Math["cos"](this["BrA"] * e2));
  }
  return l2["x"] += this["lam0"], l2;
}
var names$o = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
const g$1 = { "init": init$o, "forward": forward$n, "inverse": inverse$n, "names": names$o };
function init$n() {
  !this["lat2"] && (this["lat2"] = this["lat1"]);
  !this["k0"] && (this["k0"] = 1);
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0;
  if (Math["abs"](this["lat1"] + this["lat2"]) < EPSLN) return;
  var f2 = this["b"] / this["a"];
  this["e"] = Math["sqrt"](1 - f2 * f2);
  var g2 = Math["sin"](this["lat1"]), h2 = Math["cos"](this["lat1"]), i2 = e$6(this["e"], g2, h2), j2 = b$a(this["e"], this["lat1"], g2), k2 = Math["sin"](this["lat2"]), l2 = Math["cos"](this["lat2"]), m2 = e$6(this["e"], k2, l2), n2 = b$a(this["e"], this["lat2"], k2), o2 = b$a(this["e"], this["lat0"], Math["sin"](this["lat0"]));
  Math["abs"](this["lat1"] - this["lat2"]) > EPSLN ? this["ns"] = Math["log"](i2 / m2) / Math["log"](j2 / n2) : this["ns"] = g2, isNaN(this["ns"]) && (this["ns"] = g2), this["f0"] = i2 / (this["ns"] * Math["pow"](j2, this["ns"])), this["rh"] = this["a"] * this["f0"] * Math["pow"](o2, this["ns"]), !this["title"] && (this["title"] = "Lambert Conformal Conic");
}
function forward$m(f2) {
  var g2 = f2["x"], h2 = f2["y"];
  Math["abs"](2 * Math["abs"](h2) - Math["PI"]) <= EPSLN && (h2 = a$8(h2) * (HALF_PI - 2 * EPSLN));
  var i2 = Math["abs"](Math["abs"](h2) - HALF_PI), j2, k2;
  if (i2 > EPSLN) j2 = b$a(this["e"], h2, Math["sin"](h2)), k2 = this["a"] * this["f0"] * Math["pow"](j2, this["ns"]);
  else {
    i2 = h2 * this["ns"];
    if (i2 <= 0) return null;
    k2 = 0;
  }
  var l2 = this["ns"] * b$b(g2 - this["long0"]);
  return f2["x"] = this["k0"] * (k2 * Math["sin"](l2)) + this["x0"], f2["y"] = this["k0"] * (this["rh"] - k2 * Math["cos"](l2)) + this["y0"], f2;
}
function inverse$m(f2) {
  var g2, h2, i2, j2, k2, l2 = (f2["x"] - this["x0"]) / this["k0"], m2 = this["rh"] - (f2["y"] - this["y0"]) / this["k0"];
  this["ns"] > 0 ? (g2 = Math["sqrt"](l2 * l2 + m2 * m2), h2 = 1) : (g2 = -Math["sqrt"](l2 * l2 + m2 * m2), h2 = -1);
  var n2 = 0;
  g2 !== 0 && (n2 = Math["atan2"](h2 * l2, h2 * m2));
  if (g2 !== 0 || this["ns"] > 0) {
    h2 = 1 / this["ns"], i2 = Math["pow"](g2 / (this["a"] * this["f0"]), h2), j2 = e$5(this["e"], i2);
    if (j2 === -9999) return null;
  } else j2 = -HALF_PI;
  return k2 = b$b(n2 / this["ns"] + this["long0"]), f2["x"] = k2, f2["y"] = j2, f2;
}
var names$n = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_1SP", "Lambert_Conformal_Conic_2SP", "lcc", "Lambert Conic Conformal (1SP)", "Lambert Conic Conformal (2SP)"];
const h = { "init": init$n, "forward": forward$m, "inverse": inverse$m, "names": names$n };
function init$m() {
  this["a"] = 6377397155e-3, this["es"] = 0.006674372230614, this["e"] = Math["sqrt"](this["es"]), !this["lat0"] && (this["lat0"] = 0.863937979737193), !this["long0"] && (this["long0"] = 0.7417649320975901 - 0.308341501185665), !this["k0"] && (this["k0"] = 0.9999), this["s45"] = 0.785398163397448, this["s90"] = 2 * this["s45"], this["fi0"] = this["lat0"], this["e2"] = this["es"], this["e"] = Math["sqrt"](this["e2"]), this["alfa"] = Math["sqrt"](1 + this["e2"] * Math["pow"](Math["cos"](this["fi0"]), 4) / (1 - this["e2"])), this["uq"] = 1.04216856380474, this["u0"] = Math["asin"](Math["sin"](this["fi0"]) / this["alfa"]), this["g"] = Math["pow"]((1 + this["e"] * Math["sin"](this["fi0"])) / (1 - this["e"] * Math["sin"](this["fi0"])), this["alfa"] * this["e"] / 2), this["k"] = Math["tan"](this["u0"] / 2 + this["s45"]) / Math["pow"](Math["tan"](this["fi0"] / 2 + this["s45"]), this["alfa"]) * this["g"], this["k1"] = this["k0"], this["n0"] = this["a"] * Math["sqrt"](1 - this["e2"]) / (1 - this["e2"] * Math["pow"](Math["sin"](this["fi0"]), 2)), this["s0"] = 1.37008346281555, this["n"] = Math["sin"](this["s0"]), this["ro0"] = this["k1"] * this["n0"] / Math["tan"](this["s0"]), this["ad"] = this["s90"] - this["uq"];
}
function forward$l(b2) {
  var c2, e2, f2, g2, h2, i2, j2, k2 = b2["x"], l2 = b2["y"], m2 = b$b(k2 - this["long0"]);
  return c2 = Math["pow"]((1 + this["e"] * Math["sin"](l2)) / (1 - this["e"] * Math["sin"](l2)), this["alfa"] * this["e"] / 2), e2 = 2 * (Math["atan"](this["k"] * Math["pow"](Math["tan"](l2 / 2 + this["s45"]), this["alfa"]) / c2) - this["s45"]), f2 = -m2 * this["alfa"], g2 = Math["asin"](Math["cos"](this["ad"]) * Math["sin"](e2) + Math["sin"](this["ad"]) * Math["cos"](e2) * Math["cos"](f2)), h2 = Math["asin"](Math["cos"](e2) * Math["sin"](f2) / Math["cos"](g2)), i2 = this["n"] * h2, j2 = this["ro0"] * Math["pow"](Math["tan"](this["s0"] / 2 + this["s45"]), this["n"]) / Math["pow"](Math["tan"](g2 / 2 + this["s45"]), this["n"]), b2["y"] = j2 * Math["cos"](i2) / 1, b2["x"] = j2 * Math["sin"](i2) / 1, !this["czech"] && (b2["y"] *= -1, b2["x"] *= -1), b2;
}
function inverse$l(b2) {
  var c2, e2, f2, g2, h2, i2, j2, k2, l2 = b2["x"];
  b2["x"] = b2["y"], b2["y"] = l2;
  !this["czech"] && (b2["y"] *= -1, b2["x"] *= -1);
  i2 = Math["sqrt"](b2["x"] * b2["x"] + b2["y"] * b2["y"]), h2 = Math["atan2"](b2["y"], b2["x"]), g2 = h2 / Math["sin"](this["s0"]), f2 = 2 * (Math["atan"](Math["pow"](this["ro0"] / i2, 1 / this["n"]) * Math["tan"](this["s0"] / 2 + this["s45"])) - this["s45"]), c2 = Math["asin"](Math["cos"](this["ad"]) * Math["sin"](f2) - Math["sin"](this["ad"]) * Math["cos"](f2) * Math["cos"](g2)), e2 = Math["asin"](Math["cos"](f2) * Math["sin"](g2) / Math["cos"](c2)), b2["x"] = this["long0"] - e2 / this["alfa"], j2 = c2, k2 = 0;
  var m2 = 0;
  do {
    b2["y"] = 2 * (Math["atan"](Math["pow"](this["k"], -1 / this["alfa"]) * Math["pow"](Math["tan"](c2 / 2 + this["s45"]), 1 / this["alfa"]) * Math["pow"]((1 + this["e"] * Math["sin"](j2)) / (1 - this["e"] * Math["sin"](j2)), this["e"] / 2)) - this["s45"]), Math["abs"](j2 - b2["y"]) < 1e-10 && (k2 = 1), j2 = b2["y"], m2 += 1;
  } while (k2 === 0 && m2 < 15);
  if (m2 >= 15) return null;
  return b2;
}
var names$m = ["Krovak", "krovak"];
const i$2 = { "init": init$m, "forward": forward$l, "inverse": inverse$l, "names": names$m };
function b$3(e0, e1, e2, e3, phi) {
  return e0 * phi - e1 * Math["sin"](2 * phi) + e2 * Math["sin"](4 * phi) - e3 * Math["sin"](6 * phi);
}
function c(x2) {
  return 1 - 0.25 * x2 * (1 + x2 / 16 * (3 + 1.25 * x2));
}
function d$1(x2) {
  return 0.375 * x2 * (1 + 0.25 * x2 * (1 + 0.46875 * x2));
}
function e(x2) {
  return 0.05859375 * x2 * x2 * (1 + 0.75 * x2);
}
function f(x2) {
  return x2 * x2 * x2 * (35 / 3072);
}
function g(a2, e2, sinphi) {
  var temp = e2 * sinphi;
  return a2 / Math["sqrt"](1 - temp * temp);
}
function a$1(x2) {
  return Math["abs"](x2) < HALF_PI ? x2 : x2 - a$8(x2) * Math["PI"];
}
function i$1(ml, e0, e1, e2, e3) {
  var phi, dphi;
  phi = ml / e0;
  for (var i2 = 0; i2 < 15; i2++) {
    dphi = (ml - (e0 * phi - e1 * Math["sin"](2 * phi) + e2 * Math["sin"](4 * phi) - e3 * Math["sin"](6 * phi))) / (e0 - 2 * e1 * Math["cos"](2 * phi) + 4 * e2 * Math["cos"](4 * phi) - 6 * e3 * Math["cos"](6 * phi)), phi += dphi;
    if (Math["abs"](dphi) <= 1e-10) return phi;
  }
  return NaN;
}
function init$l() {
  !this["sphere"] && (this["e0"] = c(this["es"]), this["e1"] = d$1(this["es"]), this["e2"] = e(this["es"]), this["e3"] = f(this["es"]), this["ml0"] = this["a"] * b$3(this["e0"], this["e1"], this["e2"], this["e3"], this["lat0"]));
}
function forward$k(j2) {
  var k2, l2, m2 = j2["x"], n2 = j2["y"];
  m2 = b$b(m2 - this["long0"]);
  if (this["sphere"]) k2 = this["a"] * Math["asin"](Math["cos"](n2) * Math["sin"](m2)), l2 = this["a"] * (Math["atan2"](Math["tan"](n2), Math["cos"](m2)) - this["lat0"]);
  else {
    var o2 = Math["sin"](n2), q2 = Math["cos"](n2), r2 = g(this["a"], this["e"], o2), s2 = Math["tan"](n2) * Math["tan"](n2), t2 = m2 * Math["cos"](n2), u2 = t2 * t2, v2 = this["es"] * q2 * q2 / (1 - this["es"]), w2 = this["a"] * b$3(this["e0"], this["e1"], this["e2"], this["e3"], n2);
    k2 = r2 * t2 * (1 - u2 * s2 * (1 / 6 - (8 - s2 + 8 * v2) * u2 / 120)), l2 = w2 - this["ml0"] + r2 * o2 / q2 * u2 * (0.5 + (5 - s2 + 6 * v2) * u2 / 24);
  }
  return j2["x"] = k2 + this["x0"], j2["y"] = l2 + this["y0"], j2;
}
function inverse$k(j2) {
  j2["x"] -= this["x0"], j2["y"] -= this["y0"];
  var k2 = j2["x"] / this["a"], l2 = j2["y"] / this["a"], m2, n2;
  if (this["sphere"]) {
    var o2 = l2 + this["lat0"];
    m2 = Math["asin"](Math["sin"](o2) * Math["cos"](k2)), n2 = Math["atan2"](Math["tan"](k2), Math["cos"](o2));
  } else {
    var q2 = this["ml0"] / this["a"] + l2, r2 = i$1(q2, this["e0"], this["e1"], this["e2"], this["e3"]);
    if (Math["abs"](Math["abs"](r2) - HALF_PI) <= EPSLN) return j2["x"] = this["long0"], j2["y"] = HALF_PI, l2 < 0 && (j2["y"] *= -1), j2;
    var s2 = g(this["a"], this["e"], Math["sin"](r2)), t2 = s2 * s2 * s2 / this["a"] / this["a"] * (1 - this["es"]), u2 = Math["pow"](Math["tan"](r2), 2), v2 = k2 * this["a"] / s2, w2 = v2 * v2;
    m2 = r2 - s2 * Math["tan"](r2) / t2 * v2 * v2 * (0.5 - (1 + 3 * u2) * v2 * v2 / 24), n2 = v2 * (1 - w2 * (u2 / 3 + (1 + 3 * u2) * u2 * w2 / 15)) / Math["cos"](r2);
  }
  return j2["x"] = b$b(n2 + this["long0"]), j2["y"] = a$1(m2), j2;
}
var names$l = ["Cassini", "Cassini_Soldner", "cass"];
const j = { "init": init$l, "forward": forward$k, "inverse": inverse$k, "names": names$l };
function b$2(eccent, sinphi) {
  var con;
  return eccent > 1e-7 ? (con = eccent * sinphi, (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math["log"]((1 - con) / (1 + con)))) : 2 * sinphi;
}
var S_POLE = 1;
var N_POLE = 2;
var EQUIT = 3;
var OBLIQ = 4;
function init$k() {
  var c2 = Math["abs"](this["lat0"]);
  if (Math["abs"](c2 - HALF_PI) < EPSLN) this["mode"] = this["lat0"] < 0 ? this["S_POLE"] : this["N_POLE"];
  else Math["abs"](c2) < EPSLN ? this["mode"] = this["EQUIT"] : this["mode"] = this["OBLIQ"];
  if (this["es"] > 0) {
    var d2;
    this["qp"] = b$2(this["e"], 1), this["mmf"] = 0.5 / (1 - this["es"]), this["apa"] = authset(this["es"]);
    switch (this["mode"]) {
      case this["N_POLE"]:
        this["dd"] = 1;
        break;
      case this["S_POLE"]:
        this["dd"] = 1;
        break;
      case this["EQUIT"]:
        this["rq"] = Math["sqrt"](0.5 * this["qp"]), this["dd"] = 1 / this["rq"], this["xmf"] = 1, this["ymf"] = 0.5 * this["qp"];
        break;
      case this["OBLIQ"]:
        this["rq"] = Math["sqrt"](0.5 * this["qp"]), d2 = Math["sin"](this["lat0"]), this["sinb1"] = b$2(this["e"], d2) / this["qp"], this["cosb1"] = Math["sqrt"](1 - this["sinb1"] * this["sinb1"]), this["dd"] = Math["cos"](this["lat0"]) / (Math["sqrt"](1 - this["es"] * d2 * d2) * this["rq"] * this["cosb1"]), this["ymf"] = (this["xmf"] = this["rq"]) / this["dd"], this["xmf"] *= this["dd"];
        break;
    }
  } else this["mode"] === this["OBLIQ"] && (this["sinph0"] = Math["sin"](this["lat0"]), this["cosph0"] = Math["cos"](this["lat0"]));
}
function forward$j(c2) {
  var d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2 = c2["x"], o2 = c2["y"];
  n2 = b$b(n2 - this["long0"]);
  if (this["sphere"]) {
    h2 = Math["sin"](o2), m2 = Math["cos"](o2), f2 = Math["cos"](n2);
    if (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) {
      e2 = this["mode"] === this["EQUIT"] ? 1 + m2 * f2 : 1 + this["sinph0"] * h2 + this["cosph0"] * m2 * f2;
      if (e2 <= EPSLN) return null;
      e2 = Math["sqrt"](2 / e2), d2 = e2 * m2 * Math["sin"](n2), e2 *= this["mode"] === this["EQUIT"] ? h2 : this["cosph0"] * h2 - this["sinph0"] * m2 * f2;
    } else {
      if (this["mode"] === this["N_POLE"] || this["mode"] === this["S_POLE"]) {
        this["mode"] === this["N_POLE"] && (f2 = -f2);
        if (Math["abs"](o2 + this["lat0"]) < EPSLN) return null;
        e2 = FORTPI - o2 * 0.5, e2 = 2 * (this["mode"] === this["S_POLE"] ? Math["cos"](e2) : Math["sin"](e2)), d2 = e2 * Math["sin"](n2), e2 *= f2;
      }
    }
  } else {
    j2 = 0, k2 = 0, l2 = 0, f2 = Math["cos"](n2), g2 = Math["sin"](n2), h2 = Math["sin"](o2), i2 = b$2(this["e"], h2);
    (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) && (j2 = i2 / this["qp"], k2 = Math["sqrt"](1 - j2 * j2));
    switch (this["mode"]) {
      case this["OBLIQ"]:
        l2 = 1 + this["sinb1"] * j2 + this["cosb1"] * k2 * f2;
        break;
      case this["EQUIT"]:
        l2 = 1 + k2 * f2;
        break;
      case this["N_POLE"]:
        l2 = HALF_PI + o2, i2 = this["qp"] - i2;
        break;
      case this["S_POLE"]:
        l2 = o2 - HALF_PI, i2 = this["qp"] + i2;
        break;
    }
    if (Math["abs"](l2) < EPSLN) return null;
    switch (this["mode"]) {
      case this["OBLIQ"]:
      case this["EQUIT"]:
        l2 = Math["sqrt"](2 / l2);
        this["mode"] === this["OBLIQ"] ? e2 = this["ymf"] * l2 * (this["cosb1"] * j2 - this["sinb1"] * k2 * f2) : e2 = (l2 = Math["sqrt"](2 / (1 + k2 * f2))) * j2 * this["ymf"];
        d2 = this["xmf"] * l2 * k2 * g2;
        break;
      case this["N_POLE"]:
      case this["S_POLE"]:
        i2 >= 0 ? (d2 = (l2 = Math["sqrt"](i2)) * g2, e2 = f2 * (this["mode"] === this["S_POLE"] ? l2 : -l2)) : d2 = e2 = 0;
        break;
    }
  }
  return c2["x"] = this["a"] * d2 + this["x0"], c2["y"] = this["a"] * e2 + this["y0"], c2;
}
function inverse$j(c2) {
  c2["x"] -= this["x0"], c2["y"] -= this["y0"];
  var d2 = c2["x"] / this["a"], e2 = c2["y"] / this["a"], f2, g2, h2, i2, j2, k2, l2;
  if (this["sphere"]) {
    var m2 = 0, n2, o2 = 0;
    n2 = Math["sqrt"](d2 * d2 + e2 * e2), g2 = n2 * 0.5;
    if (g2 > 1) return null;
    g2 = 2 * Math["asin"](g2);
    (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) && (o2 = Math["sin"](g2), m2 = Math["cos"](g2));
    switch (this["mode"]) {
      case this["EQUIT"]:
        g2 = Math["abs"](n2) <= EPSLN ? 0 : Math["asin"](e2 * o2 / n2), d2 *= o2, e2 = m2 * n2;
        break;
      case this["OBLIQ"]:
        g2 = Math["abs"](n2) <= EPSLN ? this["lat0"] : Math["asin"](m2 * this["sinph0"] + e2 * o2 * this["cosph0"] / n2), d2 *= o2 * this["cosph0"], e2 = (m2 - Math["sin"](g2) * this["sinph0"]) * n2;
        break;
      case this["N_POLE"]:
        e2 = -e2, g2 = HALF_PI - g2;
        break;
      case this["S_POLE"]:
        g2 -= HALF_PI;
        break;
    }
    f2 = e2 === 0 && (this["mode"] === this["EQUIT"] || this["mode"] === this["OBLIQ"]) ? 0 : Math["atan2"](d2, e2);
  } else {
    l2 = 0;
    if (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) {
      d2 /= this["dd"], e2 *= this["dd"], k2 = Math["sqrt"](d2 * d2 + e2 * e2);
      if (k2 < EPSLN) return c2["x"] = this["long0"], c2["y"] = this["lat0"], c2;
      i2 = 2 * Math["asin"](0.5 * k2 / this["rq"]), h2 = Math["cos"](i2), d2 *= i2 = Math["sin"](i2), this["mode"] === this["OBLIQ"] ? (l2 = h2 * this["sinb1"] + e2 * i2 * this["cosb1"] / k2, j2 = this["qp"] * l2, e2 = k2 * this["cosb1"] * h2 - e2 * this["sinb1"] * i2) : (l2 = e2 * i2 / k2, j2 = this["qp"] * l2, e2 = k2 * h2);
    } else {
      if (this["mode"] === this["N_POLE"] || this["mode"] === this["S_POLE"]) {
        this["mode"] === this["N_POLE"] && (e2 = -e2);
        j2 = d2 * d2 + e2 * e2;
        if (!j2) return c2["x"] = this["long0"], c2["y"] = this["lat0"], c2;
        l2 = 1 - j2 / this["qp"], this["mode"] === this["S_POLE"] && (l2 = -l2);
      }
    }
    f2 = Math["atan2"](d2, e2), g2 = authlat(Math["asin"](l2), this["apa"]);
  }
  return c2["x"] = b$b(this["long0"] + f2), c2["y"] = g2, c2;
}
var P00 = 0.3333333333333333, P01 = 0.17222222222222222, P02 = 0.10257936507936508, P10 = 0.06388888888888888, P11 = 0.0664021164021164, P20 = 0.016415012942191543;
function authset(c2) {
  var d2, e2 = [];
  return e2[0] = c2 * P00, d2 = c2 * c2, e2[0] += d2 * P01, e2[1] = d2 * P10, d2 *= c2, e2[0] += d2 * P02, e2[1] += d2 * P11, e2[2] = d2 * P20, e2;
}
function authlat(c2, d2) {
  var e2 = c2 + c2;
  return c2 + d2[0] * Math["sin"](e2) + d2[1] * Math["sin"](e2 + e2) + d2[2] * Math["sin"](e2 + e2 + e2);
}
var names$k = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
const k = { "init": init$k, "forward": forward$j, "inverse": inverse$j, "names": names$k, "S_POLE": S_POLE, "N_POLE": N_POLE, "EQUIT": EQUIT, "OBLIQ": OBLIQ };
function b$1(x2) {
  return Math["abs"](x2) > 1 && (x2 = x2 > 1 ? 1 : -1), Math["asin"](x2);
}
function init$j() {
  if (Math["abs"](this["lat1"] + this["lat2"]) < EPSLN) return;
  this["temp"] = this["b"] / this["a"], this["es"] = 1 - Math["pow"](this["temp"], 2), this["e3"] = Math["sqrt"](this["es"]), this["sin_po"] = Math["sin"](this["lat1"]), this["cos_po"] = Math["cos"](this["lat1"]), this["t1"] = this["sin_po"], this["con"] = this["sin_po"], this["ms1"] = e$6(this["e3"], this["sin_po"], this["cos_po"]), this["qs1"] = b$2(this["e3"], this["sin_po"]), this["sin_po"] = Math["sin"](this["lat2"]), this["cos_po"] = Math["cos"](this["lat2"]), this["t2"] = this["sin_po"], this["ms2"] = e$6(this["e3"], this["sin_po"], this["cos_po"]), this["qs2"] = b$2(this["e3"], this["sin_po"]), this["sin_po"] = Math["sin"](this["lat0"]), this["cos_po"] = Math["cos"](this["lat0"]), this["t3"] = this["sin_po"], this["qs0"] = b$2(this["e3"], this["sin_po"]), Math["abs"](this["lat1"] - this["lat2"]) > EPSLN ? this["ns0"] = (this["ms1"] * this["ms1"] - this["ms2"] * this["ms2"]) / (this["qs2"] - this["qs1"]) : this["ns0"] = this["con"], this["c"] = this["ms1"] * this["ms1"] + this["ns0"] * this["qs1"], this["rh"] = this["a"] * Math["sqrt"](this["c"] - this["ns0"] * this["qs0"]) / this["ns0"];
}
function forward$i(e2) {
  var f2 = e2["x"], g2 = e2["y"];
  this["sin_phi"] = Math["sin"](g2), this["cos_phi"] = Math["cos"](g2);
  var h2 = b$2(this["e3"], this["sin_phi"]), i2 = this["a"] * Math["sqrt"](this["c"] - this["ns0"] * h2) / this["ns0"], j2 = this["ns0"] * b$b(f2 - this["long0"]), k2 = i2 * Math["sin"](j2) + this["x0"], l2 = this["rh"] - i2 * Math["cos"](j2) + this["y0"];
  return e2["x"] = k2, e2["y"] = l2, e2;
}
function inverse$i(e2) {
  var f2, g2, h2, i2, j2, k2;
  return e2["x"] -= this["x0"], e2["y"] = this["rh"] - e2["y"] + this["y0"], this["ns0"] >= 0 ? (f2 = Math["sqrt"](e2["x"] * e2["x"] + e2["y"] * e2["y"]), h2 = 1) : (f2 = -Math["sqrt"](e2["x"] * e2["x"] + e2["y"] * e2["y"]), h2 = -1), i2 = 0, f2 !== 0 && (i2 = Math["atan2"](h2 * e2["x"], h2 * e2["y"])), h2 = f2 * this["ns0"] / this["a"], this["sphere"] ? k2 = Math["asin"]((this["c"] - h2 * h2) / (2 * this["ns0"])) : (g2 = (this["c"] - h2 * h2) / this["ns0"], k2 = this["phi1z"](this["e3"], g2)), j2 = b$b(i2 / this["ns0"] + this["long0"]), e2["x"] = j2, e2["y"] = k2, e2;
}
function phi1z(e2, f2) {
  var g2, h2, j2, k2, l2, m2 = b$1(0.5 * f2);
  if (e2 < EPSLN) return m2;
  var n2 = e2 * e2;
  for (var o2 = 1; o2 <= 25; o2++) {
    g2 = Math["sin"](m2), h2 = Math["cos"](m2), j2 = e2 * g2, k2 = 1 - j2 * j2, l2 = 0.5 * k2 * k2 / h2 * (f2 / (1 - n2) - g2 / k2 + 0.5 / e2 * Math["log"]((1 - j2) / (1 + j2))), m2 = m2 + l2;
    if (Math["abs"](l2) <= 1e-7) return m2;
  }
  return null;
}
var names$j = ["Albers_Conic_Equal_Area", "Albers", "aea"];
const l = { "init": init$j, "forward": forward$i, "inverse": inverse$i, "names": names$j, "phi1z": phi1z };
function init$i() {
  this["sin_p14"] = Math["sin"](this["lat0"]), this["cos_p14"] = Math["cos"](this["lat0"]), this["infinity_dist"] = 1e3 * this["a"], this["rc"] = 1;
}
function forward$h(c2) {
  var d2, e2, f2, h2, i2, j2, k2, l2, m2 = c2["x"], n2 = c2["y"];
  return f2 = b$b(m2 - this["long0"]), d2 = Math["sin"](n2), e2 = Math["cos"](n2), h2 = Math["cos"](f2), j2 = this["sin_p14"] * d2 + this["cos_p14"] * e2 * h2, i2 = 1, j2 > 0 || Math["abs"](j2) <= EPSLN ? (k2 = this["x0"] + this["a"] * i2 * e2 * Math["sin"](f2) / j2, l2 = this["y0"] + this["a"] * i2 * (this["cos_p14"] * d2 - this["sin_p14"] * e2 * h2) / j2) : (k2 = this["x0"] + this["infinity_dist"] * e2 * Math["sin"](f2), l2 = this["y0"] + this["infinity_dist"] * (this["cos_p14"] * d2 - this["sin_p14"] * e2 * h2)), c2["x"] = k2, c2["y"] = l2, c2;
}
function inverse$h(d2) {
  var e2, f2, g2, h2, i2, j2;
  return d2["x"] = (d2["x"] - this["x0"]) / this["a"], d2["y"] = (d2["y"] - this["y0"]) / this["a"], d2["x"] /= this["k0"], d2["y"] /= this["k0"], (e2 = Math["sqrt"](d2["x"] * d2["x"] + d2["y"] * d2["y"])) ? (h2 = Math["atan2"](e2, this["rc"]), f2 = Math["sin"](h2), g2 = Math["cos"](h2), j2 = b$1(g2 * this["sin_p14"] + d2["y"] * f2 * this["cos_p14"] / e2), i2 = Math["atan2"](d2["x"] * f2, e2 * this["cos_p14"] * g2 - d2["y"] * this["sin_p14"] * f2), i2 = b$b(this["long0"] + i2)) : (j2 = this["phic0"], i2 = 0), d2["x"] = i2, d2["y"] = j2, d2;
}
var names$i = ["gnom"];
const m = { "init": init$i, "forward": forward$h, "inverse": inverse$h, "names": names$i };
function d(eccent, q2) {
  var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math["log"]((1 - eccent) / (1 + eccent));
  if (Math["abs"](Math["abs"](q2) - temp) < 1e-6) return q2 < 0 ? -1 * HALF_PI : HALF_PI;
  var phi = Math["asin"](0.5 * q2), dphi, sin_phi, cos_phi, con;
  for (var i2 = 0; i2 < 30; i2++) {
    sin_phi = Math["sin"](phi), cos_phi = Math["cos"](phi), con = eccent * sin_phi, dphi = Math["pow"](1 - con * con, 2) / (2 * cos_phi) * (q2 / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math["log"]((1 - con) / (1 + con))), phi += dphi;
    if (Math["abs"](dphi) <= 1e-10) return phi;
  }
  return NaN;
}
function init$h() {
  !this["sphere"] && (this["k0"] = e$6(this["e"], Math["sin"](this["lat_ts"]), Math["cos"](this["lat_ts"])));
}
function forward$g(e2) {
  var f2 = e2["x"], g2 = e2["y"], h2, i2, j2 = b$b(f2 - this["long0"]);
  if (this["sphere"]) h2 = this["x0"] + this["a"] * j2 * Math["cos"](this["lat_ts"]), i2 = this["y0"] + this["a"] * Math["sin"](g2) / Math["cos"](this["lat_ts"]);
  else {
    var k2 = b$2(this["e"], Math["sin"](g2));
    h2 = this["x0"] + this["a"] * this["k0"] * j2, i2 = this["y0"] + this["a"] * k2 * 0.5 / this["k0"];
  }
  return e2["x"] = h2, e2["y"] = i2, e2;
}
function inverse$g(e2) {
  e2["x"] -= this["x0"], e2["y"] -= this["y0"];
  var f2, g2;
  return this["sphere"] ? (f2 = b$b(this["long0"] + e2["x"] / this["a"] / Math["cos"](this["lat_ts"])), g2 = Math["asin"](e2["y"] / this["a"] * Math["cos"](this["lat_ts"]))) : (g2 = d(this["e"], 2 * e2["y"] * this["k0"] / this["a"]), f2 = b$b(this["long0"] + e2["x"] / (this["a"] * this["k0"]))), e2["x"] = f2, e2["y"] = g2, e2;
}
var names$h = ["cea"];
const n = { "init": init$h, "forward": forward$g, "inverse": inverse$g, "names": names$h };
function init$g() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["lat0"] = this["lat0"] || 0, this["long0"] = this["long0"] || 0, this["lat_ts"] = this["lat_ts"] || 0, this["title"] = this["title"] || "Equidistant Cylindrical (Plate Carre)", this["rc"] = Math["cos"](this["lat_ts"]);
}
function forward$f(c2) {
  var d2 = c2["x"], e2 = c2["y"], f2 = b$b(d2 - this["long0"]), g2 = a$1(e2 - this["lat0"]);
  return c2["x"] = this["x0"] + this["a"] * f2 * this["rc"], c2["y"] = this["y0"] + this["a"] * g2, c2;
}
function inverse$f(c2) {
  var d2 = c2["x"], e2 = c2["y"];
  return c2["x"] = b$b(this["long0"] + (d2 - this["x0"]) / (this["a"] * this["rc"])), c2["y"] = a$1(this["lat0"] + (e2 - this["y0"]) / this["a"]), c2;
}
var names$g = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
const o = { "init": init$g, "forward": forward$f, "inverse": inverse$f, "names": names$g };
var MAX_ITER$1 = 20;
function init$f() {
  this["temp"] = this["b"] / this["a"], this["es"] = 1 - Math["pow"](this["temp"], 2), this["e"] = Math["sqrt"](this["es"]), this["e0"] = c(this["es"]), this["e1"] = d$1(this["es"]), this["e2"] = e(this["es"]), this["e3"] = f(this["es"]), this["ml0"] = this["a"] * b$3(this["e0"], this["e1"], this["e2"], this["e3"], this["lat0"]);
}
function forward$e(i2) {
  var j2 = i2["x"], k2 = i2["y"], l2, m2, n2, o2 = b$b(j2 - this["long0"]);
  n2 = o2 * Math["sin"](k2);
  if (this["sphere"]) Math["abs"](k2) <= EPSLN ? (l2 = this["a"] * o2, m2 = -1 * this["a"] * this["lat0"]) : (l2 = this["a"] * Math["sin"](n2) / Math["tan"](k2), m2 = this["a"] * (a$1(k2 - this["lat0"]) + (1 - Math["cos"](n2)) / Math["tan"](k2)));
  else {
    if (Math["abs"](k2) <= EPSLN) l2 = this["a"] * o2, m2 = -1 * this["ml0"];
    else {
      var q2 = g(this["a"], this["e"], Math["sin"](k2)) / Math["tan"](k2);
      l2 = q2 * Math["sin"](n2), m2 = this["a"] * b$3(this["e0"], this["e1"], this["e2"], this["e3"], k2) - this["ml0"] + q2 * (1 - Math["cos"](n2));
    }
  }
  return i2["x"] = l2 + this["x0"], i2["y"] = m2 + this["y0"], i2;
}
function inverse$e(j2) {
  var k2, l2, m2, n2, o2, q2, r2, s2, t2;
  m2 = j2["x"] - this["x0"], n2 = j2["y"] - this["y0"];
  if (this["sphere"]) {
    if (Math["abs"](n2 + this["a"] * this["lat0"]) <= EPSLN) k2 = b$b(m2 / this["a"] + this["long0"]), l2 = 0;
    else {
      q2 = this["lat0"] + n2 / this["a"], r2 = m2 * m2 / this["a"] / this["a"] + q2 * q2, s2 = q2;
      var u2;
      for (o2 = MAX_ITER$1; o2; --o2) {
        u2 = Math["tan"](s2), t2 = -1 * (q2 * (s2 * u2 + 1) - s2 - 0.5 * (s2 * s2 + r2) * u2) / ((s2 - q2) / u2 - 1), s2 += t2;
        if (Math["abs"](t2) <= EPSLN) {
          l2 = s2;
          break;
        }
      }
      k2 = b$b(this["long0"] + Math["asin"](m2 * Math["tan"](s2) / this["a"]) / Math["sin"](l2));
    }
  } else {
    if (Math["abs"](n2 + this["ml0"]) <= EPSLN) l2 = 0, k2 = b$b(this["long0"] + m2 / this["a"]);
    else {
      q2 = (this["ml0"] + n2) / this["a"], r2 = m2 * m2 / this["a"] / this["a"] + q2 * q2, s2 = q2;
      var v2, w2, z2, A5, B2;
      for (o2 = MAX_ITER$1; o2; --o2) {
        B2 = this["e"] * Math["sin"](s2), v2 = Math["sqrt"](1 - B2 * B2) * Math["tan"](s2), w2 = this["a"] * b$3(this["e0"], this["e1"], this["e2"], this["e3"], s2), z2 = this["e0"] - 2 * this["e1"] * Math["cos"](2 * s2) + 4 * this["e2"] * Math["cos"](4 * s2) - 6 * this["e3"] * Math["cos"](6 * s2), A5 = w2 / this["a"], t2 = (q2 * (v2 * A5 + 1) - A5 - 0.5 * v2 * (A5 * A5 + r2)) / (this["es"] * Math["sin"](2 * s2) * (A5 * A5 + r2 - 2 * q2 * A5) / (4 * v2) + (q2 - A5) * (v2 * z2 - 2 / Math["sin"](2 * s2)) - z2), s2 -= t2;
        if (Math["abs"](t2) <= EPSLN) {
          l2 = s2;
          break;
        }
      }
      v2 = Math["sqrt"](1 - this["es"] * Math["pow"](Math["sin"](l2), 2)) * Math["tan"](l2), k2 = b$b(this["long0"] + Math["asin"](m2 * v2 / this["a"]) / Math["sin"](l2));
    }
  }
  return j2["x"] = k2, j2["y"] = l2, j2;
}
var names$f = ["Polyconic", "poly"];
const p = { "init": init$f, "forward": forward$e, "inverse": inverse$e, "names": names$f };
function init$e() {
  this["A"] = [], this["A"][1] = 0.6399175073, this["A"][2] = -0.1358797613, this["A"][3] = 0.063294409, this["A"][4] = -0.02526853, this["A"][5] = 0.0117879, this["A"][6] = -55161e-7, this["A"][7] = 26906e-7, this["A"][8] = -1333e-6, this["A"][9] = 67e-5, this["A"][10] = -34e-5, this["B_re"] = [], this["B_im"] = [], this["B_re"][1] = 0.7557853228, this["B_im"][1] = 0, this["B_re"][2] = 0.249204646, this["B_im"][2] = 3371507e-9, this["B_re"][3] = -1541739e-9, this["B_im"][3] = 0.04105856, this["B_re"][4] = -0.10162907, this["B_im"][4] = 0.01727609, this["B_re"][5] = -0.26623489, this["B_im"][5] = -0.36249218, this["B_re"][6] = -0.6870983, this["B_im"][6] = -1.1651967, this["C_re"] = [], this["C_im"] = [], this["C_re"][1] = 1.3231270439, this["C_im"][1] = 0, this["C_re"][2] = -0.577245789, this["C_im"][2] = -7809598e-9, this["C_re"][3] = 0.508307513, this["C_im"][3] = -0.112208952, this["C_re"][4] = -0.15094762, this["C_im"][4] = 0.18200602, this["C_re"][5] = 1.01418179, this["C_im"][5] = 1.64497696, this["C_re"][6] = 1.9660549, this["C_im"][6] = 2.5127645, this["D"] = [], this["D"][1] = 1.5627014243, this["D"][2] = 0.5185406398, this["D"][3] = -0.03333098, this["D"][4] = -0.1052906, this["D"][5] = -0.0368594, this["D"][6] = 7317e-6, this["D"][7] = 0.0122, this["D"][8] = 394e-5, this["D"][9] = -13e-4;
}
function forward$d(a2) {
  var b2, c2 = a2["x"], d2 = a2["y"], e2 = d2 - this["lat0"], f2 = c2 - this["long0"], g2 = e2 / SEC_TO_RAD * 1e-5, h2 = f2, i2 = 1, j2 = 0;
  for (b2 = 1; b2 <= 10; b2++) {
    i2 = i2 * g2, j2 = j2 + this["A"][b2] * i2;
  }
  var k2 = j2, l2 = h2, m2 = 1, o2 = 0, q2, r2, s2 = 0, t2 = 0;
  for (b2 = 1; b2 <= 6; b2++) {
    q2 = m2 * k2 - o2 * l2, r2 = o2 * k2 + m2 * l2, m2 = q2, o2 = r2, s2 = s2 + this["B_re"][b2] * m2 - this["B_im"][b2] * o2, t2 = t2 + this["B_im"][b2] * m2 + this["B_re"][b2] * o2;
  }
  return a2["x"] = t2 * this["a"] + this["x0"], a2["y"] = s2 * this["a"] + this["y0"], a2;
}
function inverse$d(a2) {
  var b2, c2 = a2["x"], d2 = a2["y"], e2 = c2 - this["x0"], f2 = d2 - this["y0"], g2 = f2 / this["a"], h2 = e2 / this["a"], j2 = 1, k2 = 0, l2, m2, o2 = 0, q2 = 0;
  for (b2 = 1; b2 <= 6; b2++) {
    l2 = j2 * g2 - k2 * h2, m2 = k2 * g2 + j2 * h2, j2 = l2, k2 = m2, o2 = o2 + this["C_re"][b2] * j2 - this["C_im"][b2] * k2, q2 = q2 + this["C_im"][b2] * j2 + this["C_re"][b2] * k2;
  }
  for (var r2 = 0; r2 < this["iterations"]; r2++) {
    var s2 = o2, t2 = q2, u2, v2, w2 = g2, z2 = h2;
    for (b2 = 2; b2 <= 6; b2++) {
      u2 = s2 * o2 - t2 * q2, v2 = t2 * o2 + s2 * q2, s2 = u2, t2 = v2, w2 = w2 + (b2 - 1) * (this["B_re"][b2] * s2 - this["B_im"][b2] * t2), z2 = z2 + (b2 - 1) * (this["B_im"][b2] * s2 + this["B_re"][b2] * t2);
    }
    s2 = 1, t2 = 0;
    var A5 = this["B_re"][1], B2 = this["B_im"][1];
    for (b2 = 2; b2 <= 6; b2++) {
      u2 = s2 * o2 - t2 * q2, v2 = t2 * o2 + s2 * q2, s2 = u2, t2 = v2, A5 = A5 + b2 * (this["B_re"][b2] * s2 - this["B_im"][b2] * t2), B2 = B2 + b2 * (this["B_im"][b2] * s2 + this["B_re"][b2] * t2);
    }
    var C2 = A5 * A5 + B2 * B2;
    o2 = (w2 * A5 + z2 * B2) / C2, q2 = (z2 * A5 - w2 * B2) / C2;
  }
  var D2 = o2, E2 = q2, F = 1, G = 0;
  for (b2 = 1; b2 <= 9; b2++) {
    F = F * D2, G = G + this["D"][b2] * F;
  }
  var H = this["lat0"] + G * SEC_TO_RAD * 1e5, I2 = this["long0"] + E2;
  return a2["x"] = I2, a2["y"] = H, a2;
}
var names$e = ["New_Zealand_Map_Grid", "nzmg"];
const q = { "init": init$e, "forward": forward$d, "inverse": inverse$d, "names": names$e };
function init$d() {
}
function forward$c(b2) {
  var c2 = b2["x"], d2 = b2["y"], e2 = b$b(c2 - this["long0"]), f2 = this["x0"] + this["a"] * e2, g2 = this["y0"] + this["a"] * Math["log"](Math["tan"](Math["PI"] / 4 + d2 / 2.5)) * 1.25;
  return b2["x"] = f2, b2["y"] = g2, b2;
}
function inverse$c(b2) {
  b2["x"] -= this["x0"], b2["y"] -= this["y0"];
  var c2 = b$b(this["long0"] + b2["x"] / this["a"]), d2 = 2.5 * (Math["atan"](Math["exp"](0.8 * b2["y"] / this["a"])) - Math["PI"] / 4);
  return b2["x"] = c2, b2["y"] = d2, b2;
}
var names$d = ["Miller_Cylindrical", "mill"];
const r = { "init": init$d, "forward": forward$c, "inverse": inverse$c, "names": names$d };
var MAX_ITER = 20;
function init$c() {
  !this["sphere"] ? this["en"] = d$4(this["es"]) : (this["n"] = 1, this["m"] = 0, this["es"] = 0, this["C_y"] = Math["sqrt"]((this["m"] + 1) / this["n"]), this["C_x"] = this["C_y"] / (this["m"] + 1));
}
function forward$b(g2) {
  var h2, j2, l2 = g2["x"], m2 = g2["y"];
  l2 = b$b(l2 - this["long0"]);
  if (this["sphere"]) {
    if (!this["m"]) m2 = this["n"] !== 1 ? Math["asin"](this["n"] * Math["sin"](m2)) : m2;
    else {
      var n2 = this["n"] * Math["sin"](m2);
      for (var o2 = MAX_ITER; o2; --o2) {
        var q2 = (this["m"] * m2 + Math["sin"](m2) - n2) / (this["m"] + Math["cos"](m2));
        m2 -= q2;
        if (Math["abs"](q2) < EPSLN) break;
      }
    }
    h2 = this["a"] * this["C_x"] * l2 * (this["m"] + Math["cos"](m2)), j2 = this["a"] * this["C_y"] * m2;
  } else {
    var r2 = Math["sin"](m2), t2 = Math["cos"](m2);
    j2 = this["a"] * f$3(m2, r2, t2, this["en"]), h2 = this["a"] * l2 * t2 / Math["sqrt"](1 - this["es"] * r2 * r2);
  }
  return g2["x"] = h2, g2["y"] = j2, g2;
}
function inverse$b(g2) {
  var h2, i2, j2, k2;
  g2["x"] -= this["x0"], j2 = g2["x"] / this["a"], g2["y"] -= this["y0"], h2 = g2["y"] / this["a"];
  if (this["sphere"]) {
    h2 /= this["C_y"], j2 = j2 / (this["C_x"] * (this["m"] + Math["cos"](h2)));
    if (this["m"]) h2 = b$1((this["m"] * h2 + Math["sin"](h2)) / this["n"]);
    else this["n"] !== 1 && (h2 = b$1(Math["sin"](h2) / this["n"]));
    j2 = b$b(j2 + this["long0"]), h2 = a$1(h2);
  } else {
    h2 = e$3(g2["y"] / this["a"], this["es"], this["en"]), k2 = Math["abs"](h2);
    if (k2 < HALF_PI) k2 = Math["sin"](h2), i2 = this["long0"] + g2["x"] * Math["sqrt"](1 - this["es"] * k2 * k2) / (this["a"] * Math["cos"](h2)), j2 = b$b(i2);
    else k2 - EPSLN < HALF_PI && (j2 = this["long0"]);
  }
  return g2["x"] = j2, g2["y"] = h2, g2;
}
var names$c = ["Sinusoidal", "sinu"];
const s = { "init": init$c, "forward": forward$b, "inverse": inverse$b, "names": names$c };
function init$b() {
}
function forward$a(b2) {
  var c2 = b2["x"], d2 = b2["y"], e2 = b$b(c2 - this["long0"]), f2 = d2, g2 = Math["PI"] * Math["sin"](d2);
  while (!![]) {
    var h2 = -(f2 + Math["sin"](f2) - g2) / (1 + Math["cos"](f2));
    f2 += h2;
    if (Math["abs"](h2) < EPSLN) break;
  }
  f2 /= 2;
  Math["PI"] / 2 - Math["abs"](d2) < EPSLN && (e2 = 0);
  var i2 = 0.900316316158 * this["a"] * e2 * Math["cos"](f2) + this["x0"], j2 = 1.4142135623731 * this["a"] * Math["sin"](f2) + this["y0"];
  return b2["x"] = i2, b2["y"] = j2, b2;
}
function inverse$a(b2) {
  var c2, d2;
  b2["x"] -= this["x0"], b2["y"] -= this["y0"], d2 = b2["y"] / (1.4142135623731 * this["a"]);
  Math["abs"](d2) > 0.999999999999 && (d2 = 0.999999999999);
  c2 = Math["asin"](d2);
  var e2 = b$b(this["long0"] + b2["x"] / (0.900316316158 * this["a"] * Math["cos"](c2)));
  e2 < -Math["PI"] && (e2 = -Math["PI"]);
  e2 > Math["PI"] && (e2 = Math["PI"]);
  d2 = (2 * c2 + Math["sin"](2 * c2)) / Math["PI"];
  Math["abs"](d2) > 1 && (d2 = 1);
  var f2 = Math["asin"](d2);
  return b2["x"] = e2, b2["y"] = f2, b2;
}
var names$b = ["Mollweide", "moll"];
const t = { "init": init$b, "forward": forward$a, "inverse": inverse$a, "names": names$b };
function init$a() {
  if (Math["abs"](this["lat1"] + this["lat2"]) < EPSLN) return;
  this["lat2"] = this["lat2"] || this["lat1"], this["temp"] = this["b"] / this["a"], this["es"] = 1 - Math["pow"](this["temp"], 2), this["e"] = Math["sqrt"](this["es"]), this["e0"] = c(this["es"]), this["e1"] = d$1(this["es"]), this["e2"] = e(this["es"]), this["e3"] = f(this["es"]), this["sinphi"] = Math["sin"](this["lat1"]), this["cosphi"] = Math["cos"](this["lat1"]), this["ms1"] = e$6(this["e"], this["sinphi"], this["cosphi"]), this["ml1"] = b$3(this["e0"], this["e1"], this["e2"], this["e3"], this["lat1"]), Math["abs"](this["lat1"] - this["lat2"]) < EPSLN ? this["ns"] = this["sinphi"] : (this["sinphi"] = Math["sin"](this["lat2"]), this["cosphi"] = Math["cos"](this["lat2"]), this["ms2"] = e$6(this["e"], this["sinphi"], this["cosphi"]), this["ml2"] = b$3(this["e0"], this["e1"], this["e2"], this["e3"], this["lat2"]), this["ns"] = (this["ms1"] - this["ms2"]) / (this["ml2"] - this["ml1"])), this["g"] = this["ml1"] + this["ms1"] / this["ns"], this["ml0"] = b$3(this["e0"], this["e1"], this["e2"], this["e3"], this["lat0"]), this["rh"] = this["a"] * (this["g"] - this["ml0"]);
}
function forward$9(j2) {
  var k2 = j2["x"], l2 = j2["y"], m2;
  if (this["sphere"]) m2 = this["a"] * (this["g"] - l2);
  else {
    var n2 = b$3(this["e0"], this["e1"], this["e2"], this["e3"], l2);
    m2 = this["a"] * (this["g"] - n2);
  }
  var o2 = this["ns"] * b$b(k2 - this["long0"]), q2 = this["x0"] + m2 * Math["sin"](o2), r2 = this["y0"] + this["rh"] - m2 * Math["cos"](o2);
  return j2["x"] = q2, j2["y"] = r2, j2;
}
function inverse$9(j2) {
  j2["x"] -= this["x0"], j2["y"] = this["rh"] - j2["y"] + this["y0"];
  var k2, l2, m2, n2;
  this["ns"] >= 0 ? (l2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), k2 = 1) : (l2 = -Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), k2 = -1);
  var o2 = 0;
  l2 !== 0 && (o2 = Math["atan2"](k2 * j2["x"], k2 * j2["y"]));
  if (this["sphere"]) return n2 = b$b(this["long0"] + o2 / this["ns"]), m2 = a$1(this["g"] - l2 / this["a"]), j2["x"] = n2, j2["y"] = m2, j2;
  else {
    var q2 = this["g"] - l2 / this["a"];
    return m2 = i$1(q2, this["e0"], this["e1"], this["e2"], this["e3"]), n2 = b$b(this["long0"] + o2 / this["ns"]), j2["x"] = n2, j2["y"] = m2, j2;
  }
}
var names$a = ["Equidistant_Conic", "eqdc"];
const u = { "init": init$a, "forward": forward$9, "inverse": inverse$9, "names": names$a };
function init$9() {
  this["R"] = this["a"];
}
function forward$8(c2) {
  var d2 = c2["x"], e2 = c2["y"], f2 = b$b(d2 - this["long0"]), h2, i2;
  Math["abs"](e2) <= EPSLN && (h2 = this["x0"] + this["R"] * f2, i2 = this["y0"]);
  var j2 = b$1(2 * Math["abs"](e2 / Math["PI"]));
  (Math["abs"](f2) <= EPSLN || Math["abs"](Math["abs"](e2) - HALF_PI) <= EPSLN) && (h2 = this["x0"], e2 >= 0 ? i2 = this["y0"] + Math["PI"] * this["R"] * Math["tan"](0.5 * j2) : i2 = this["y0"] + Math["PI"] * this["R"] * -Math["tan"](0.5 * j2));
  var k2 = 0.5 * Math["abs"](Math["PI"] / f2 - f2 / Math["PI"]), l2 = k2 * k2, n2 = Math["sin"](j2), o2 = Math["cos"](j2), r2 = o2 / (n2 + o2 - 1), s2 = r2 * r2, t2 = r2 * (2 / n2 - 1), u2 = t2 * t2, v2 = Math["PI"] * this["R"] * (k2 * (r2 - u2) + Math["sqrt"](l2 * (r2 - u2) * (r2 - u2) - (u2 + l2) * (s2 - u2))) / (u2 + l2);
  f2 < 0 && (v2 = -v2);
  h2 = this["x0"] + v2;
  var w2 = l2 + r2;
  return v2 = Math["PI"] * this["R"] * (t2 * w2 - k2 * Math["sqrt"]((u2 + l2) * (l2 + 1) - w2 * w2)) / (u2 + l2), e2 >= 0 ? i2 = this["y0"] + v2 : i2 = this["y0"] - v2, c2["x"] = h2, c2["y"] = i2, c2;
}
function inverse$8(c2) {
  var e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, q2, r2;
  return c2["x"] -= this["x0"], c2["y"] -= this["y0"], o2 = Math["PI"] * this["R"], g2 = c2["x"] / o2, h2 = c2["y"] / o2, i2 = g2 * g2 + h2 * h2, j2 = -Math["abs"](h2) * (1 + i2), k2 = j2 - 2 * h2 * h2 + g2 * g2, l2 = -2 * j2 + 1 + 2 * h2 * h2 + i2 * i2, r2 = h2 * h2 / l2 + (2 * k2 * k2 * k2 / l2 / l2 / l2 - 9 * j2 * k2 / l2 / l2) / 27, m2 = (j2 - k2 * k2 / 3 / l2) / l2, n2 = 2 * Math["sqrt"](-m2 / 3), o2 = 3 * r2 / m2 / n2, Math["abs"](o2) > 1 && (o2 >= 0 ? o2 = 1 : o2 = -1), q2 = Math["acos"](o2) / 3, c2["y"] >= 0 ? f2 = (-n2 * Math["cos"](q2 + Math["PI"] / 3) - k2 / 3 / l2) * Math["PI"] : f2 = -(-n2 * Math["cos"](q2 + Math["PI"] / 3) - k2 / 3 / l2) * Math["PI"], Math["abs"](g2) < EPSLN ? e2 = this["long0"] : e2 = b$b(this["long0"] + Math["PI"] * (i2 - 1 + Math["sqrt"](1 + 2 * (g2 * g2 - h2 * h2) + i2 * i2)) / 2 / g2), c2["x"] = e2, c2["y"] = f2, c2;
}
var names$9 = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
const v = { "init": init$9, "forward": forward$8, "inverse": inverse$8, "names": names$9 };
function init$8() {
  this["sin_p12"] = Math["sin"](this["lat0"]), this["cos_p12"] = Math["cos"](this["lat0"]);
}
function forward$7(j2) {
  var k2 = j2["x"], l2 = j2["y"], m2 = Math["sin"](j2["y"]), n2 = Math["cos"](j2["y"]), o2 = b$b(k2 - this["long0"]), q2, r2, t2, u2, v2, w2, x2, y2, z2, A5, B2, C2, D2, E2, F, I2, J, K, L, M2, N, O2, P;
  if (this["sphere"]) {
    if (Math["abs"](this["sin_p12"] - 1) <= EPSLN) return j2["x"] = this["x0"] + this["a"] * (HALF_PI - l2) * Math["sin"](o2), j2["y"] = this["y0"] - this["a"] * (HALF_PI - l2) * Math["cos"](o2), j2;
    else return Math["abs"](this["sin_p12"] + 1) <= EPSLN ? (j2["x"] = this["x0"] + this["a"] * (HALF_PI + l2) * Math["sin"](o2), j2["y"] = this["y0"] + this["a"] * (HALF_PI + l2) * Math["cos"](o2), j2) : (K = this["sin_p12"] * m2 + this["cos_p12"] * n2 * Math["cos"](o2), I2 = Math["acos"](K), J = I2 ? I2 / Math["sin"](I2) : 1, j2["x"] = this["x0"] + this["a"] * J * n2 * Math["sin"](o2), j2["y"] = this["y0"] + this["a"] * J * (this["cos_p12"] * m2 - this["sin_p12"] * n2 * Math["cos"](o2)), j2);
  } else {
    q2 = c(this["es"]), r2 = d$1(this["es"]), t2 = e(this["es"]), u2 = f(this["es"]);
    if (Math["abs"](this["sin_p12"] - 1) <= EPSLN) return v2 = this["a"] * b$3(q2, r2, t2, u2, HALF_PI), w2 = this["a"] * b$3(q2, r2, t2, u2, l2), j2["x"] = this["x0"] + (v2 - w2) * Math["sin"](o2), j2["y"] = this["y0"] - (v2 - w2) * Math["cos"](o2), j2;
    else {
      if (Math["abs"](this["sin_p12"] + 1) <= EPSLN) return v2 = this["a"] * b$3(q2, r2, t2, u2, HALF_PI), w2 = this["a"] * b$3(q2, r2, t2, u2, l2), j2["x"] = this["x0"] + (v2 + w2) * Math["sin"](o2), j2["y"] = this["y0"] + (v2 + w2) * Math["cos"](o2), j2;
      else {
        x2 = m2 / n2, y2 = g(this["a"], this["e"], this["sin_p12"]), z2 = g(this["a"], this["e"], m2), A5 = Math["atan"]((1 - this["es"]) * x2 + this["es"] * y2 * this["sin_p12"] / (z2 * n2)), B2 = Math["atan2"](Math["sin"](o2), this["cos_p12"] * Math["tan"](A5) - this["sin_p12"] * Math["cos"](o2));
        if (B2 === 0) L = Math["asin"](this["cos_p12"] * Math["sin"](A5) - this["sin_p12"] * Math["cos"](A5));
        else Math["abs"](Math["abs"](B2) - Math["PI"]) <= EPSLN ? L = -Math["asin"](this["cos_p12"] * Math["sin"](A5) - this["sin_p12"] * Math["cos"](A5)) : L = Math["asin"](Math["sin"](o2) * Math["cos"](A5) / Math["sin"](B2));
        return C2 = this["e"] * this["sin_p12"] / Math["sqrt"](1 - this["es"]), D2 = this["e"] * this["cos_p12"] * Math["cos"](B2) / Math["sqrt"](1 - this["es"]), E2 = C2 * D2, F = D2 * D2, M2 = L * L, N = M2 * L, O2 = N * L, P = O2 * L, I2 = y2 * L * (1 - M2 * F * (1 - F) / 6 + N / 8 * E2 * (1 - 2 * F) + O2 / 120 * (F * (4 - 7 * F) - 3 * C2 * C2 * (1 - 7 * F)) - P / 48 * E2), j2["x"] = this["x0"] + I2 * Math["sin"](B2), j2["y"] = this["y0"] + I2 * Math["cos"](B2), j2;
      }
    }
  }
}
function inverse$7(j2) {
  j2["x"] -= this["x0"], j2["y"] -= this["y0"];
  var k2, l2, m2, n2, o2, q2, r2, s2, t2, u2, v2, w2, x2, y2, C2, E2, G, H, I2, J, K, L, N, O2;
  if (this["sphere"]) {
    k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]);
    if (k2 > 2 * HALF_PI * this["a"]) return;
    return l2 = k2 / this["a"], m2 = Math["sin"](l2), n2 = Math["cos"](l2), o2 = this["long0"], Math["abs"](k2) <= EPSLN ? q2 = this["lat0"] : (q2 = b$1(n2 * this["sin_p12"] + j2["y"] * m2 * this["cos_p12"] / k2), r2 = Math["abs"](this["lat0"]) - HALF_PI, Math["abs"](r2) <= EPSLN ? this["lat0"] >= 0 ? o2 = b$b(this["long0"] + Math["atan2"](j2["x"], -j2["y"])) : o2 = b$b(this["long0"] - Math["atan2"](-j2["x"], j2["y"])) : o2 = b$b(this["long0"] + Math["atan2"](j2["x"] * m2, k2 * this["cos_p12"] * n2 - j2["y"] * this["sin_p12"] * m2))), j2["x"] = o2, j2["y"] = q2, j2;
  } else {
    s2 = c(this["es"]), t2 = d$1(this["es"]), u2 = e(this["es"]), v2 = f(this["es"]);
    if (Math["abs"](this["sin_p12"] - 1) <= EPSLN) return w2 = this["a"] * b$3(s2, t2, u2, v2, HALF_PI), k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), x2 = w2 - k2, q2 = i$1(x2 / this["a"], s2, t2, u2, v2), o2 = b$b(this["long0"] + Math["atan2"](j2["x"], -1 * j2["y"])), j2["x"] = o2, j2["y"] = q2, j2;
    else return Math["abs"](this["sin_p12"] + 1) <= EPSLN ? (w2 = this["a"] * b$3(s2, t2, u2, v2, HALF_PI), k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), x2 = k2 - w2, q2 = i$1(x2 / this["a"], s2, t2, u2, v2), o2 = b$b(this["long0"] + Math["atan2"](j2["x"], j2["y"])), j2["x"] = o2, j2["y"] = q2, j2) : (k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), E2 = Math["atan2"](j2["x"], j2["y"]), y2 = g(this["a"], this["e"], this["sin_p12"]), G = Math["cos"](E2), H = this["e"] * this["cos_p12"] * G, I2 = -H * H / (1 - this["es"]), J = 3 * this["es"] * (1 - I2) * this["sin_p12"] * this["cos_p12"] * G / (1 - this["es"]), K = k2 / y2, L = K - I2 * (1 + I2) * Math["pow"](K, 3) / 6 - J * (1 + 3 * I2) * Math["pow"](K, 4) / 24, N = 1 - I2 * L * L / 2 - K * L * L * L / 6, C2 = Math["asin"](this["sin_p12"] * Math["cos"](L) + this["cos_p12"] * Math["sin"](L) * G), o2 = b$b(this["long0"] + Math["asin"](Math["sin"](E2) * Math["sin"](L) / Math["cos"](C2))), O2 = Math["sin"](C2), q2 = Math["atan2"]((O2 - this["es"] * N * this["sin_p12"]) * Math["tan"](C2), O2 * (1 - this["es"])), j2["x"] = o2, j2["y"] = q2, j2);
  }
}
var names$8 = ["Azimuthal_Equidistant", "aeqd"];
const w = { "init": init$8, "forward": forward$7, "inverse": inverse$7, "names": names$8 };
function init$7() {
  this["sin_p14"] = Math["sin"](this["lat0"]), this["cos_p14"] = Math["cos"](this["lat0"]);
}
function forward$6(c2) {
  var d2, e2, f2, h2, i2, j2, k2, l2, m2 = c2["x"], n2 = c2["y"];
  return f2 = b$b(m2 - this["long0"]), d2 = Math["sin"](n2), e2 = Math["cos"](n2), h2 = Math["cos"](f2), j2 = this["sin_p14"] * d2 + this["cos_p14"] * e2 * h2, i2 = 1, (j2 > 0 || Math["abs"](j2) <= EPSLN) && (k2 = this["a"] * i2 * e2 * Math["sin"](f2), l2 = this["y0"] + this["a"] * i2 * (this["cos_p14"] * d2 - this["sin_p14"] * e2 * h2)), c2["x"] = k2, c2["y"] = l2, c2;
}
function inverse$6(c2) {
  var d2, e2, f2, g2, h2, i2, j2;
  c2["x"] -= this["x0"], c2["y"] -= this["y0"], d2 = Math["sqrt"](c2["x"] * c2["x"] + c2["y"] * c2["y"]), e2 = b$1(d2 / this["a"]), f2 = Math["sin"](e2), g2 = Math["cos"](e2), i2 = this["long0"];
  if (Math["abs"](d2) <= EPSLN) return j2 = this["lat0"], c2["x"] = i2, c2["y"] = j2, c2;
  j2 = b$1(g2 * this["sin_p14"] + c2["y"] * f2 * this["cos_p14"] / d2), h2 = Math["abs"](this["lat0"]) - HALF_PI;
  if (Math["abs"](h2) <= EPSLN) return this["lat0"] >= 0 ? i2 = b$b(this["long0"] + Math["atan2"](c2["x"], -c2["y"])) : i2 = b$b(this["long0"] - Math["atan2"](-c2["x"], c2["y"])), c2["x"] = i2, c2["y"] = j2, c2;
  return i2 = b$b(this["long0"] + Math["atan2"](c2["x"] * f2, d2 * this["cos_p14"] * g2 - c2["y"] * this["sin_p14"] * f2)), c2["x"] = i2, c2["y"] = j2, c2;
}
var names$7 = ["ortho"];
const x = { "init": init$7, "forward": forward$6, "inverse": inverse$6, "names": names$7 };
var FACE_ENUM = { "FRONT": 1, "RIGHT": 2, "BACK": 3, "LEFT": 4, "TOP": 5, "BOTTOM": 6 }, AREA_ENUM = { "AREA_0": 1, "AREA_1": 2, "AREA_2": 3, "AREA_3": 4 };
function init$6() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["lat0"] = this["lat0"] || 0, this["long0"] = this["long0"] || 0, this["lat_ts"] = this["lat_ts"] || 0, this["title"] = this["title"] || "Quadrilateralized Spherical Cube";
  if (this["lat0"] >= HALF_PI - FORTPI / 2) this["face"] = FACE_ENUM["TOP"];
  else {
    if (this["lat0"] <= -(HALF_PI - FORTPI / 2)) this["face"] = FACE_ENUM["BOTTOM"];
    else {
      if (Math["abs"](this["long0"]) <= FORTPI) this["face"] = FACE_ENUM["FRONT"];
      else Math["abs"](this["long0"]) <= HALF_PI + FORTPI ? this["face"] = this["long0"] > 0 ? FACE_ENUM["RIGHT"] : FACE_ENUM["LEFT"] : this["face"] = FACE_ENUM["BACK"];
    }
  }
  this["es"] !== 0 && (this["one_minus_f"] = 1 - (this["a"] - this["b"]) / this["a"], this["one_minus_f_squared"] = this["one_minus_f"] * this["one_minus_f"]);
}
function forward$5(a2) {
  var b2 = { "x": 0, "y": 0 }, c2, d2, e2, f2, g2, h2, i2 = { "value": 0 };
  a2["x"] -= this["long0"];
  this["es"] !== 0 ? c2 = Math["atan"](this["one_minus_f_squared"] * Math["tan"](a2["y"])) : c2 = a2["y"];
  d2 = a2["x"];
  if (this["face"] === FACE_ENUM["TOP"]) {
    f2 = HALF_PI - c2;
    if (d2 >= FORTPI && d2 <= HALF_PI + FORTPI) i2["value"] = AREA_ENUM["AREA_0"], e2 = d2 - HALF_PI;
    else {
      if (d2 > HALF_PI + FORTPI || d2 <= -(HALF_PI + FORTPI)) i2["value"] = AREA_ENUM["AREA_1"], e2 = d2 > 0 ? d2 - SPI : d2 + SPI;
      else d2 > -(HALF_PI + FORTPI) && d2 <= -FORTPI ? (i2["value"] = AREA_ENUM["AREA_2"], e2 = d2 + HALF_PI) : (i2["value"] = AREA_ENUM["AREA_3"], e2 = d2);
    }
  } else {
    if (this["face"] === FACE_ENUM["BOTTOM"]) {
      f2 = HALF_PI + c2;
      if (d2 >= FORTPI && d2 <= HALF_PI + FORTPI) i2["value"] = AREA_ENUM["AREA_0"], e2 = -d2 + HALF_PI;
      else {
        if (d2 < FORTPI && d2 >= -FORTPI) i2["value"] = AREA_ENUM["AREA_1"], e2 = -d2;
        else d2 < -FORTPI && d2 >= -(HALF_PI + FORTPI) ? (i2["value"] = AREA_ENUM["AREA_2"], e2 = -d2 - HALF_PI) : (i2["value"] = AREA_ENUM["AREA_3"], e2 = d2 > 0 ? -d2 + SPI : -d2 - SPI);
      }
    } else {
      var j2, k2, l2, m2, n2, o2, u2;
      if (this["face"] === FACE_ENUM["RIGHT"]) d2 = qsc_shift_lon_origin(d2, +HALF_PI);
      else {
        if (this["face"] === FACE_ENUM["BACK"]) d2 = qsc_shift_lon_origin(d2, +SPI);
        else this["face"] === FACE_ENUM["LEFT"] && (d2 = qsc_shift_lon_origin(d2, -HALF_PI));
      }
      m2 = Math["sin"](c2), n2 = Math["cos"](c2), o2 = Math["sin"](d2), u2 = Math["cos"](d2), j2 = n2 * u2, k2 = n2 * o2, l2 = m2;
      if (this["face"] === FACE_ENUM["FRONT"]) f2 = Math["acos"](j2), e2 = qsc_fwd_equat_face_theta(f2, l2, k2, i2);
      else {
        if (this["face"] === FACE_ENUM["RIGHT"]) f2 = Math["acos"](k2), e2 = qsc_fwd_equat_face_theta(f2, l2, -j2, i2);
        else {
          if (this["face"] === FACE_ENUM["BACK"]) f2 = Math["acos"](-j2), e2 = qsc_fwd_equat_face_theta(f2, l2, -k2, i2);
          else this["face"] === FACE_ENUM["LEFT"] ? (f2 = Math["acos"](-k2), e2 = qsc_fwd_equat_face_theta(f2, l2, j2, i2)) : (f2 = e2 = 0, i2["value"] = AREA_ENUM["AREA_0"]);
        }
      }
    }
  }
  h2 = Math["atan"](12 / SPI * (e2 + Math["acos"](Math["sin"](e2) * Math["cos"](FORTPI)) - HALF_PI)), g2 = Math["sqrt"]((1 - Math["cos"](f2)) / (Math["cos"](h2) * Math["cos"](h2)) / (1 - Math["cos"](Math["atan"](1 / Math["cos"](e2)))));
  if (i2["value"] === AREA_ENUM["AREA_1"]) h2 += HALF_PI;
  else {
    if (i2["value"] === AREA_ENUM["AREA_2"]) h2 += SPI;
    else i2["value"] === AREA_ENUM["AREA_3"] && (h2 += 1.5 * SPI);
  }
  return b2["x"] = g2 * Math["cos"](h2), b2["y"] = g2 * Math["sin"](h2), b2["x"] = b2["x"] * this["a"] + this["x0"], b2["y"] = b2["y"] * this["a"] + this["y0"], a2["x"] = b2["x"], a2["y"] = b2["y"], a2;
}
function inverse$5(a2) {
  var b2 = { "lam": 0, "phi": 0 }, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2 = { "value": 0 };
  a2["x"] = (a2["x"] - this["x0"]) / this["a"], a2["y"] = (a2["y"] - this["y0"]) / this["a"], d2 = Math["atan"](Math["sqrt"](a2["x"] * a2["x"] + a2["y"] * a2["y"])), c2 = Math["atan2"](a2["y"], a2["x"]);
  if (a2["x"] >= 0 && a2["x"] >= Math["abs"](a2["y"])) l2["value"] = AREA_ENUM["AREA_0"];
  else {
    if (a2["y"] >= 0 && a2["y"] >= Math["abs"](a2["x"])) l2["value"] = AREA_ENUM["AREA_1"], c2 -= HALF_PI;
    else a2["x"] < 0 && -a2["x"] >= Math["abs"](a2["y"]) ? (l2["value"] = AREA_ENUM["AREA_2"], c2 = c2 < 0 ? c2 + SPI : c2 - SPI) : (l2["value"] = AREA_ENUM["AREA_3"], c2 += HALF_PI);
  }
  k2 = SPI / 12 * Math["tan"](c2), g2 = Math["sin"](k2) / (Math["cos"](k2) - 1 / Math["sqrt"](2)), h2 = Math["atan"](g2), e2 = Math["cos"](c2), f2 = Math["tan"](d2), i2 = 1 - e2 * e2 * f2 * f2 * (1 - Math["cos"](Math["atan"](1 / Math["cos"](h2))));
  if (i2 < -1) i2 = -1;
  else i2 > 1 && (i2 = 1);
  if (this["face"] === FACE_ENUM["TOP"]) {
    j2 = Math["acos"](i2), b2["phi"] = HALF_PI - j2;
    if (l2["value"] === AREA_ENUM["AREA_0"]) b2["lam"] = h2 + HALF_PI;
    else {
      if (l2["value"] === AREA_ENUM["AREA_1"]) b2["lam"] = h2 < 0 ? h2 + SPI : h2 - SPI;
      else l2["value"] === AREA_ENUM["AREA_2"] ? b2["lam"] = h2 - HALF_PI : b2["lam"] = h2;
    }
  } else {
    if (this["face"] === FACE_ENUM["BOTTOM"]) {
      j2 = Math["acos"](i2), b2["phi"] = j2 - HALF_PI;
      if (l2["value"] === AREA_ENUM["AREA_0"]) b2["lam"] = -h2 + HALF_PI;
      else {
        if (l2["value"] === AREA_ENUM["AREA_1"]) b2["lam"] = -h2;
        else l2["value"] === AREA_ENUM["AREA_2"] ? b2["lam"] = -h2 - HALF_PI : b2["lam"] = h2 < 0 ? -h2 - SPI : -h2 + SPI;
      }
    } else {
      var m2, n2, o2;
      m2 = i2, k2 = m2 * m2;
      k2 >= 1 ? o2 = 0 : o2 = Math["sqrt"](1 - k2) * Math["sin"](h2);
      k2 += o2 * o2;
      k2 >= 1 ? n2 = 0 : n2 = Math["sqrt"](1 - k2);
      if (l2["value"] === AREA_ENUM["AREA_1"]) k2 = n2, n2 = -o2, o2 = k2;
      else {
        if (l2["value"] === AREA_ENUM["AREA_2"]) n2 = -n2, o2 = -o2;
        else l2["value"] === AREA_ENUM["AREA_3"] && (k2 = n2, n2 = o2, o2 = -k2);
      }
      if (this["face"] === FACE_ENUM["RIGHT"]) k2 = m2, m2 = -n2, n2 = k2;
      else {
        if (this["face"] === FACE_ENUM["BACK"]) m2 = -m2, n2 = -n2;
        else this["face"] === FACE_ENUM["LEFT"] && (k2 = m2, m2 = n2, n2 = -k2);
      }
      b2["phi"] = Math["acos"](-o2) - HALF_PI, b2["lam"] = Math["atan2"](n2, m2);
      if (this["face"] === FACE_ENUM["RIGHT"]) b2["lam"] = qsc_shift_lon_origin(b2["lam"], -HALF_PI);
      else {
        if (this["face"] === FACE_ENUM["BACK"]) b2["lam"] = qsc_shift_lon_origin(b2["lam"], -SPI);
        else this["face"] === FACE_ENUM["LEFT"] && (b2["lam"] = qsc_shift_lon_origin(b2["lam"], +HALF_PI));
      }
    }
  }
  if (this["es"] !== 0) {
    var u2, v2, w2;
    u2 = b2["phi"] < 0 ? 1 : 0, v2 = Math["tan"](b2["phi"]), w2 = this["b"] / Math["sqrt"](v2 * v2 + this["one_minus_f_squared"]), b2["phi"] = Math["atan"](Math["sqrt"](this["a"] * this["a"] - w2 * w2) / (this["one_minus_f"] * w2)), u2 && (b2["phi"] = -b2["phi"]);
  }
  return b2["lam"] += this["long0"], a2["x"] = b2["lam"], a2["y"] = b2["phi"], a2;
}
function qsc_fwd_equat_face_theta(a2, b2, c2, d2) {
  var e2;
  if (a2 < EPSLN) d2["value"] = AREA_ENUM["AREA_0"], e2 = 0;
  else {
    e2 = Math["atan2"](b2, c2);
    if (Math["abs"](e2) <= FORTPI) d2["value"] = AREA_ENUM["AREA_0"];
    else {
      if (e2 > FORTPI && e2 <= HALF_PI + FORTPI) d2["value"] = AREA_ENUM["AREA_1"], e2 -= HALF_PI;
      else e2 > HALF_PI + FORTPI || e2 <= -(HALF_PI + FORTPI) ? (d2["value"] = AREA_ENUM["AREA_2"], e2 = e2 >= 0 ? e2 - SPI : e2 + SPI) : (d2["value"] = AREA_ENUM["AREA_3"], e2 += HALF_PI);
    }
  }
  return e2;
}
function qsc_shift_lon_origin(a2, b2) {
  var c2 = a2 + b2;
  if (c2 < -SPI) c2 += TWO_PI;
  else c2 > +SPI && (c2 -= TWO_PI);
  return c2;
}
var names$6 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
const y = { "init": init$6, "forward": forward$5, "inverse": inverse$5, "names": names$6 };
var COEFS_X = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], COEFS_Y = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], FXC = 0.8487, FYC = 1.3523, C1 = R2D / 5, RC1 = 1 / C1, NODES = 18, poly3_val = function(b2, c2) {
  return b2[0] + c2 * (b2[1] + c2 * (b2[2] + c2 * b2[3]));
}, poly3_der = function(b2, c2) {
  return b2[1] + c2 * (2 * b2[2] + c2 * 3 * b2[3]);
};
function newton_rapshon(b2, c2, d2, e2) {
  var f2 = c2;
  for (; e2; --e2) {
    var g2 = b2(f2);
    f2 -= g2;
    if (Math["abs"](g2) < d2) break;
  }
  return f2;
}
function init$5() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["long0"] = this["long0"] || 0, this["es"] = 0, this["title"] = this["title"] || "Robinson";
}
function forward$4(b2) {
  var c2 = b$b(b2["x"] - this["long0"]), d2 = Math["abs"](b2["y"]), e2 = Math["floor"](d2 * C1);
  if (e2 < 0) e2 = 0;
  else e2 >= NODES && (e2 = NODES - 1);
  d2 = R2D * (d2 - RC1 * e2);
  var f2 = { "x": poly3_val(COEFS_X[e2], d2) * c2, "y": poly3_val(COEFS_Y[e2], d2) };
  return b2["y"] < 0 && (f2["y"] = -f2["y"]), f2["x"] = f2["x"] * this["a"] * FXC + this["x0"], f2["y"] = f2["y"] * this["a"] * FYC + this["y0"], f2;
}
function inverse$4(b2) {
  var c2 = { "x": (b2["x"] - this["x0"]) / (this["a"] * FXC), "y": Math["abs"](b2["y"] - this["y0"]) / (this["a"] * FYC) };
  if (c2["y"] >= 1) c2["x"] /= COEFS_X[NODES][0], c2["y"] = b2["y"] < 0 ? -HALF_PI : HALF_PI;
  else {
    var d2 = Math["floor"](c2["y"] * NODES);
    if (d2 < 0) d2 = 0;
    else d2 >= NODES && (d2 = NODES - 1);
    for (; ; ) {
      if (COEFS_Y[d2][0] > c2["y"]) --d2;
      else {
        if (COEFS_Y[d2 + 1][0] <= c2["y"]) ++d2;
        else break;
      }
    }
    var e2 = COEFS_Y[d2], f2 = 5 * (c2["y"] - e2[0]) / (COEFS_Y[d2 + 1][0] - e2[0]);
    f2 = newton_rapshon(function(g2) {
      return (poly3_val(e2, g2) - c2["y"]) / poly3_der(e2, g2);
    }, f2, EPSLN, 100), c2["x"] /= poly3_val(COEFS_X[d2], f2), c2["y"] = (5 * d2 + f2) * D2R$1, b2["y"] < 0 && (c2["y"] = -c2["y"]);
  }
  return c2["x"] = b$b(c2["x"] + this["long0"]), c2;
}
var names$5 = ["Robinson", "robin"];
const z = { "init": init$5, "forward": forward$4, "inverse": inverse$4, "names": names$5 };
function init$4() {
  this["name"] = "geocent";
}
function forward$3(a2) {
  var b2 = geodeticToGeocentric(a2, this["es"], this["a"]);
  return b2;
}
function inverse$3(a2) {
  var b2 = geocentricToGeodetic(a2, this["es"], this["a"], this["b"]);
  return b2;
}
var names$4 = ["Geocentric", "geocentric", "geocent", "Geocent"];
const A = { "init": init$4, "forward": forward$3, "inverse": inverse$3, "names": names$4 };
var mode = { "N_POLE": 0, "S_POLE": 1, "EQUIT": 2, "OBLIQ": 3 };
var params = { "h": { "def": 1e5, "num": !![] }, "azi": { "def": 0, "num": !![], "degrees": !![] }, "tilt": { "def": 0, "num": !![], "degrees": !![] }, "long0": { "def": 0, "num": !![] }, "lat0": { "def": 0, "num": !![] } };
function init$3() {
  Object["keys"](params)["forEach"]((function(d2) {
    if (typeof this[d2] === "undefined") this[d2] = params[d2]["def"];
    else {
      if (params[d2]["num"] && isNaN(this[d2])) throw new Error("Invalid parameter value, must be numeric " + d2 + " = " + this[d2]);
      else params[d2]["num"] && (this[d2] = parseFloat(this[d2]));
    }
    params[d2]["degrees"] && (this[d2] = this[d2] * D2R$1);
  })["bind"](this));
  if (Math["abs"](Math["abs"](this["lat0"]) - HALF_PI) < EPSLN) this["mode"] = this["lat0"] < 0 ? mode["S_POLE"] : mode["N_POLE"];
  else Math["abs"](this["lat0"]) < EPSLN ? this["mode"] = mode["EQUIT"] : (this["mode"] = mode["OBLIQ"], this["sinph0"] = Math["sin"](this["lat0"]), this["cosph0"] = Math["cos"](this["lat0"]));
  this["pn1"] = this["h"] / this["a"];
  if (this["pn1"] <= 0 || this["pn1"] > 1e10) throw new Error("Invalid height");
  this["p"] = 1 + this["pn1"], this["rp"] = 1 / this["p"], this["h1"] = 1 / this["pn1"], this["pfact"] = (this["p"] + 1) * this["h1"], this["es"] = 0;
  var b2 = this["tilt"], c2 = this["azi"];
  this["cg"] = Math["cos"](c2), this["sg"] = Math["sin"](c2), this["cw"] = Math["cos"](b2), this["sw"] = Math["sin"](b2);
}
function forward$2(b2) {
  b2["x"] -= this["long0"];
  var c2 = Math["sin"](b2["y"]), d2 = Math["cos"](b2["y"]), e2 = Math["cos"](b2["x"]), f2, g2;
  switch (this["mode"]) {
    case mode["OBLIQ"]:
      g2 = this["sinph0"] * c2 + this["cosph0"] * d2 * e2;
      break;
    case mode["EQUIT"]:
      g2 = d2 * e2;
      break;
    case mode["S_POLE"]:
      g2 = -c2;
      break;
    case mode["N_POLE"]:
      g2 = c2;
      break;
  }
  g2 = this["pn1"] / (this["p"] - g2), f2 = g2 * d2 * Math["sin"](b2["x"]);
  switch (this["mode"]) {
    case mode["OBLIQ"]:
      g2 *= this["cosph0"] * c2 - this["sinph0"] * d2 * e2;
      break;
    case mode["EQUIT"]:
      g2 *= c2;
      break;
    case mode["N_POLE"]:
      g2 *= -(d2 * e2);
      break;
    case mode["S_POLE"]:
      g2 *= d2 * e2;
      break;
  }
  var h2, i2;
  return h2 = g2 * this["cg"] + f2 * this["sg"], i2 = 1 / (h2 * this["sw"] * this["h1"] + this["cw"]), f2 = (f2 * this["cg"] - g2 * this["sg"]) * this["cw"] * i2, g2 = h2 * i2, b2["x"] = f2 * this["a"], b2["y"] = g2 * this["a"], b2;
}
function inverse$2(b2) {
  b2["x"] /= this["a"], b2["y"] /= this["a"];
  var c2 = { "x": b2["x"], "y": b2["y"] }, d2, e2, f2;
  f2 = 1 / (this["pn1"] - b2["y"] * this["sw"]), d2 = this["pn1"] * b2["x"] * f2, e2 = this["pn1"] * b2["y"] * this["cw"] * f2, b2["x"] = d2 * this["cg"] + e2 * this["sg"], b2["y"] = e2 * this["cg"] - d2 * this["sg"];
  var g2 = c$2(b2["x"], b2["y"]);
  if (Math["abs"](g2) < EPSLN) c2["x"] = 0, c2["y"] = b2["y"];
  else {
    var h2, i2;
    i2 = 1 - g2 * g2 * this["pfact"], i2 = (this["p"] - Math["sqrt"](i2)) / (this["pn1"] / g2 + g2 / this["pn1"]), h2 = Math["sqrt"](1 - i2 * i2);
    switch (this["mode"]) {
      case mode["OBLIQ"]:
        c2["y"] = Math["asin"](h2 * this["sinph0"] + b2["y"] * i2 * this["cosph0"] / g2), b2["y"] = (h2 - this["sinph0"] * Math["sin"](c2["y"])) * g2, b2["x"] *= i2 * this["cosph0"];
        break;
      case mode["EQUIT"]:
        c2["y"] = Math["asin"](b2["y"] * i2 / g2), b2["y"] = h2 * g2, b2["x"] *= i2;
        break;
      case mode["N_POLE"]:
        c2["y"] = Math["asin"](h2), b2["y"] = -b2["y"];
        break;
      case mode["S_POLE"]:
        c2["y"] = -Math["asin"](h2);
        break;
    }
    c2["x"] = Math["atan2"](b2["x"], b2["y"]);
  }
  return b2["x"] = c2["x"] + this["long0"], b2["y"] = c2["y"], b2;
}
var names$3 = ["Tilted_Perspective", "tpers"];
const B = { "init": init$3, "forward": forward$2, "inverse": inverse$2, "names": names$3 };
function init$2() {
  this["flip_axis"] = this["sweep"] === "x" ? 1 : 0, this["h"] = Number(this["h"]), this["radius_g_1"] = this["h"] / this["a"];
  if (this["radius_g_1"] <= 0 || this["radius_g_1"] > 1e10) throw new Error();
  this["radius_g"] = 1 + this["radius_g_1"], this["C"] = this["radius_g"] * this["radius_g"] - 1;
  if (this["es"] !== 0) {
    var b2 = 1 - this["es"], c2 = 1 / b2;
    this["radius_p"] = Math["sqrt"](b2), this["radius_p2"] = b2, this["radius_p_inv2"] = c2, this["shape"] = "ellipse";
  } else this["radius_p"] = 1, this["radius_p2"] = 1, this["radius_p_inv2"] = 1, this["shape"] = "sphere";
  !this["title"] && (this["title"] = "Geostationary Satellite View");
}
function forward$1(b2) {
  var c2 = b2["x"], d2 = b2["y"], e2, f2, g2, h2;
  c2 = c2 - this["long0"];
  if (this["shape"] === "ellipse") {
    d2 = Math["atan"](this["radius_p2"] * Math["tan"](d2));
    var i2 = this["radius_p"] / c$2(this["radius_p"] * Math["cos"](d2), Math["sin"](d2));
    f2 = i2 * Math["cos"](c2) * Math["cos"](d2), g2 = i2 * Math["sin"](c2) * Math["cos"](d2), h2 = i2 * Math["sin"](d2);
    if ((this["radius_g"] - f2) * f2 - g2 * g2 - h2 * h2 * this["radius_p_inv2"] < 0) return b2["x"] = Number["NaN"], b2["y"] = Number["NaN"], b2;
    e2 = this["radius_g"] - f2, this["flip_axis"] ? (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / c$2(h2, e2)), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / e2)) : (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / e2), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / c$2(g2, e2)));
  } else this["shape"] === "sphere" && (e2 = Math["cos"](d2), f2 = Math["cos"](c2) * e2, g2 = Math["sin"](c2) * e2, h2 = Math["sin"](d2), e2 = this["radius_g"] - f2, this["flip_axis"] ? (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / c$2(h2, e2)), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / e2)) : (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / e2), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / c$2(g2, e2))));
  return b2["x"] = b2["x"] * this["a"], b2["y"] = b2["y"] * this["a"], b2;
}
function inverse$1(c2) {
  var d2 = -1, e2 = 0, f2 = 0, g2, h2, i2, j2;
  c2["x"] = c2["x"] / this["a"], c2["y"] = c2["y"] / this["a"];
  if (this["shape"] === "ellipse") {
    this["flip_axis"] ? (f2 = Math["tan"](c2["y"] / this["radius_g_1"]), e2 = Math["tan"](c2["x"] / this["radius_g_1"]) * c$2(1, f2)) : (e2 = Math["tan"](c2["x"] / this["radius_g_1"]), f2 = Math["tan"](c2["y"] / this["radius_g_1"]) * c$2(1, e2));
    var l2 = f2 / this["radius_p"];
    g2 = e2 * e2 + l2 * l2 + d2 * d2, h2 = 2 * this["radius_g"] * d2, i2 = h2 * h2 - 4 * g2 * this["C"];
    if (i2 < 0) return c2["x"] = Number["NaN"], c2["y"] = Number["NaN"], c2;
    j2 = (-h2 - Math["sqrt"](i2)) / (2 * g2), d2 = this["radius_g"] + j2 * d2, e2 *= j2, f2 *= j2, c2["x"] = Math["atan2"](e2, d2), c2["y"] = Math["atan"](f2 * Math["cos"](c2["x"]) / d2), c2["y"] = Math["atan"](this["radius_p_inv2"] * Math["tan"](c2["y"]));
  } else {
    if (this["shape"] === "sphere") {
      this["flip_axis"] ? (f2 = Math["tan"](c2["y"] / this["radius_g_1"]), e2 = Math["tan"](c2["x"] / this["radius_g_1"]) * Math["sqrt"](1 + f2 * f2)) : (e2 = Math["tan"](c2["x"] / this["radius_g_1"]), f2 = Math["tan"](c2["y"] / this["radius_g_1"]) * Math["sqrt"](1 + e2 * e2));
      g2 = e2 * e2 + f2 * f2 + d2 * d2, h2 = 2 * this["radius_g"] * d2, i2 = h2 * h2 - 4 * g2 * this["C"];
      if (i2 < 0) return c2["x"] = Number["NaN"], c2["y"] = Number["NaN"], c2;
      j2 = (-h2 - Math["sqrt"](i2)) / (2 * g2), d2 = this["radius_g"] + j2 * d2, e2 *= j2, f2 *= j2, c2["x"] = Math["atan2"](e2, d2), c2["y"] = Math["atan"](f2 * Math["cos"](c2["x"]) / d2);
    }
  }
  return c2["x"] = c2["x"] + this["long0"], c2;
}
var names$2 = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
const C = { "init": init$2, "forward": forward$1, "inverse": inverse$1, "names": names$2 };
var A1 = 1.340264, A2 = -0.081106, A3 = 893e-6, A4 = 3796e-6, M = Math["sqrt"](3) / 2;
function init$1() {
  this["es"] = 0, this["long0"] = this["long0"] !== void 0 ? this["long0"] : 0;
}
function forward(b2) {
  var c2 = b$b(b2["x"] - this["long0"]), d2 = b2["y"], e2 = Math["asin"](M * Math["sin"](d2)), f2 = e2 * e2, g2 = f2 * f2 * f2;
  return b2["x"] = c2 * Math["cos"](e2) / (M * (A1 + 3 * A2 * f2 + g2 * (7 * A3 + 9 * A4 * f2))), b2["y"] = e2 * (A1 + A2 * f2 + g2 * (A3 + A4 * f2)), b2["x"] = this["a"] * b2["x"] + this["x0"], b2["y"] = this["a"] * b2["y"] + this["y0"], b2;
}
function inverse(b2) {
  b2["x"] = (b2["x"] - this["x0"]) / this["a"], b2["y"] = (b2["y"] - this["y0"]) / this["a"];
  var c2 = 1e-9, d2 = 12, e2 = b2["y"], f2, g2, h2, j2, k2, l2;
  for (l2 = 0; l2 < d2; ++l2) {
    f2 = e2 * e2, g2 = f2 * f2 * f2, h2 = e2 * (A1 + A2 * f2 + g2 * (A3 + A4 * f2)) - b2["y"], j2 = A1 + 3 * A2 * f2 + g2 * (7 * A3 + 9 * A4 * f2), e2 -= k2 = h2 / j2;
    if (Math["abs"](k2) < c2) break;
  }
  return f2 = e2 * e2, g2 = f2 * f2 * f2, b2["x"] = M * b2["x"] * (A1 + 3 * A2 * f2 + g2 * (7 * A3 + 9 * A4 * f2)) / Math["cos"](e2), b2["y"] = Math["asin"](Math["sin"](e2) / M), b2["x"] = b$b(b2["x"] + this["long0"]), b2;
}
var names$1 = ["eqearth", "Equal Earth", "Equal_Earth"];
const D = { "init": init$1, "forward": forward, "inverse": inverse, "names": names$1 };
var EPS10 = 1e-10;
function init() {
  var g2;
  this["phi1"] = this["lat1"];
  if (Math["abs"](this["phi1"]) < EPS10) throw new Error();
  this["es"] ? (this["en"] = d$4(this["es"]), this["m1"] = f$3(this["phi1"], this["am1"] = Math["sin"](this["phi1"]), g2 = Math["cos"](this["phi1"]), this["en"]), this["am1"] = g2 / (Math["sqrt"](1 - this["es"] * this["am1"] * this["am1"]) * this["am1"]), this["inverse"] = e_inv, this["forward"] = e_fwd) : (Math["abs"](this["phi1"]) + EPS10 >= HALF_PI ? this["cphi1"] = 0 : this["cphi1"] = 1 / Math["tan"](this["phi1"]), this["inverse"] = s_inv, this["forward"] = s_fwd);
}
function e_fwd(g2) {
  var h2 = b$b(g2["x"] - (this["long0"] || 0)), i2 = g2["y"], j2, k2, l2;
  return j2 = this["am1"] + this["m1"] - f$3(i2, k2 = Math["sin"](i2), l2 = Math["cos"](i2), this["en"]), k2 = l2 * h2 / (j2 * Math["sqrt"](1 - this["es"] * k2 * k2)), g2["x"] = j2 * Math["sin"](k2), g2["y"] = this["am1"] - j2 * Math["cos"](k2), g2["x"] = this["a"] * g2["x"] + (this["x0"] || 0), g2["y"] = this["a"] * g2["y"] + (this["y0"] || 0), g2;
}
function e_inv(g2) {
  g2["x"] = (g2["x"] - (this["x0"] || 0)) / this["a"], g2["y"] = (g2["y"] - (this["y0"] || 0)) / this["a"];
  var h2, i2, j2, k2;
  i2 = c$2(g2["x"], g2["y"] = this["am1"] - g2["y"]), k2 = e$3(this["am1"] + this["m1"] - i2, this["es"], this["en"]);
  if ((h2 = Math["abs"](k2)) < HALF_PI) h2 = Math["sin"](k2), j2 = i2 * Math["atan2"](g2["x"], g2["y"]) * Math["sqrt"](1 - this["es"] * h2 * h2) / Math["cos"](k2);
  else {
    if (Math["abs"](h2 - HALF_PI) <= EPS10) j2 = 0;
    else throw new Error();
  }
  return g2["x"] = b$b(j2 + (this["long0"] || 0)), g2["y"] = a$1(k2), g2;
}
function s_fwd(g2) {
  var h2 = b$b(g2["x"] - (this["long0"] || 0)), i2 = g2["y"], j2, k2;
  return k2 = this["cphi1"] + this["phi1"] - i2, Math["abs"](k2) > EPS10 ? (g2["x"] = k2 * Math["sin"](j2 = h2 * Math["cos"](i2) / k2), g2["y"] = this["cphi1"] - k2 * Math["cos"](j2)) : g2["x"] = g2["y"] = 0, g2["x"] = this["a"] * g2["x"] + (this["x0"] || 0), g2["y"] = this["a"] * g2["y"] + (this["y0"] || 0), g2;
}
function s_inv(g2) {
  g2["x"] = (g2["x"] - (this["x0"] || 0)) / this["a"], g2["y"] = (g2["y"] - (this["y0"] || 0)) / this["a"];
  var h2, i2, j2 = c$2(g2["x"], g2["y"] = this["cphi1"] - g2["y"]);
  i2 = this["cphi1"] + this["phi1"] - j2;
  if (Math["abs"](i2) > HALF_PI) throw new Error();
  return Math["abs"](Math["abs"](i2) - HALF_PI) <= EPS10 ? h2 = 0 : h2 = j2 * Math["atan2"](g2["x"], g2["y"]) / Math["cos"](i2), g2["x"] = b$b(h2 + (this["long0"] || 0)), g2["y"] = a$1(i2), g2;
}
var names = ["bonne", "Bonne (Werner lat_1=90)"];
const E = { "init": init, "names": names };
function i(proj42) {
  proj42["Proj"]["projections"]["add"](a$5), proj42["Proj"]["projections"]["add"](b$4), proj42["Proj"]["projections"]["add"](c$1), proj42["Proj"]["projections"]["add"](d$2), proj42["Proj"]["projections"]["add"](e$1), proj42["Proj"]["projections"]["add"](f$1), proj42["Proj"]["projections"]["add"](g$1), proj42["Proj"]["projections"]["add"](h), proj42["Proj"]["projections"]["add"](i$2), proj42["Proj"]["projections"]["add"](j), proj42["Proj"]["projections"]["add"](k), proj42["Proj"]["projections"]["add"](l), proj42["Proj"]["projections"]["add"](m), proj42["Proj"]["projections"]["add"](n), proj42["Proj"]["projections"]["add"](o), proj42["Proj"]["projections"]["add"](p), proj42["Proj"]["projections"]["add"](q), proj42["Proj"]["projections"]["add"](r), proj42["Proj"]["projections"]["add"](s), proj42["Proj"]["projections"]["add"](t), proj42["Proj"]["projections"]["add"](u), proj42["Proj"]["projections"]["add"](v), proj42["Proj"]["projections"]["add"](w), proj42["Proj"]["projections"]["add"](x), proj42["Proj"]["projections"]["add"](y), proj42["Proj"]["projections"]["add"](z), proj42["Proj"]["projections"]["add"](A), proj42["Proj"]["projections"]["add"](B), proj42["Proj"]["projections"]["add"](C), proj42["Proj"]["projections"]["add"](D), proj42["Proj"]["projections"]["add"](E);
}
proj4["defaultDatum"] = "WGS84", proj4["Proj"] = Projection, proj4["WGS84"] = new proj4["Proj"]("WGS84"), proj4["Point"] = Point, proj4["toPoint"] = d$5, proj4["defs"] = defs, proj4["nadgrid"] = nadgrid, proj4["transform"] = transform, proj4["mgrs"] = h$1, proj4["version"] = "__VERSION__", i(proj4);
function degree2dms(d2) {
  d2 = Math["abs"](d2);
  const e2 = Math["floor"](d2), f2 = Math["floor"]((d2 - e2) * 60), g2 = Math["round"]((d2 - e2) * 3600 % 60);
  return { "degree": e2, "minute": f2, "second": g2, "str": e2 + "° " + f2 + "'  " + g2 + '"' };
}
function dms2degree(d2, e2, f2) {
  const g2 = Math["abs"](d2) + e2 / 60 + f2 / 3600;
  return g2;
}
function getCGCS2000EPSGByLng(d2, e2, f2 = !![]) {
  let g2;
  if (e2) {
    const h2 = Math["floor"](d2 / 6) + 1;
    if (h2 < 13 || h2 > 23) return void 0;
    f2 ? g2 = h2 + 4478 : g2 = h2 + 4489;
  } else {
    const i2 = Math["floor"]((d2 - 1.5) / 3) + 1;
    if (i2 < 25 || i2 > 45) return void 0;
    f2 ? g2 = i2 + 4488 : g2 = i2 + 4509;
  }
  return "EPSG:" + g2;
}
function getCGCS2000EPSGByX(d2) {
  const e2 = Number["parseInt"](d2["toString"]()["slice"](0, 2));
  if (e2 >= 13 && e2 <= 23) return "EPSG:" + (e2 + 4478);
  else return e2 >= 25 && e2 <= 45 ? "EPSG:" + (e2 + 4488) : void 0;
}
function cartesian2lonlat(d2, e2 = ![]) {
  const f2 = a$b["Cartographic"]["fromCartesian"](d2);
  if (!f2) return null;
  const g2 = LatLngPoint["FormatLength"], h2 = LatLngPoint["FormatAltLength"], i2 = a$b["Math"]["toDegrees"](f2["longitude"])["toFixed"](g2), j2 = a$b["Math"]["toDegrees"](f2["latitude"])["toFixed"](g2);
  if (e2) return [Number["parseFloat"](i2), Number["parseFloat"](j2)];
  else {
    const k2 = f2["height"]["toFixed"](h2);
    return [Number["parseFloat"](i2), Number["parseFloat"](j2), Number["parseFloat"](k2)];
  }
}
function cartesians2lonlats(d2, e2 = ![]) {
  const f2 = [];
  for (let g2 = 0, h2 = d2["length"]; g2 < h2; g2++) {
    const j2 = cartesian2lonlat(d2[g2], e2);
    j2 && f2["push"](j2);
  }
  return f2;
}
function cartesian2mercator(d2) {
  if (!d2) return null;
  const e2 = cartesian2lonlat(d2);
  if (!e2) return null;
  return lonlat2mercator(e2);
}
function cartesians2mercators(d2) {
  const e2 = [];
  for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
    const h2 = cartesian2mercator(d2[f2]);
    h2 && e2["push"](h2);
  }
  return e2["length"] > 0 ? e2 : null;
}
function lonlat2cartesian(d2, e2 = 0) {
  if (!d2 || d2["length"] < 2) return null;
  return a$b["Cartesian3"]["fromDegrees"](d2[0], d2[1], d2[2] || e2);
}
function lonlats2cartesians(d2, e2) {
  const f2 = [];
  for (let g2 = 0, h2 = d2["length"]; g2 < h2; g2++) {
    const j2 = d2[g2];
    if (Array["isArray"](j2[0])) {
      const k2 = lonlats2cartesians(j2, e2);
      k2 && k2["length"] > 0 && f2["push"](k2);
    } else {
      const l2 = lonlat2cartesian(j2, e2);
      l2 && f2["push"](l2);
    }
  }
  return f2;
}
function lonlat2mercator(d2) {
  return jwd2mct(d2);
}
function lonlats2mercators(d2) {
  const e2 = [];
  for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
    const h2 = lonlat2mercator(d2[f2]);
    h2 && e2["push"](h2);
  }
  return e2;
}
function mercator2cartesian(d2, e2) {
  if (Number["isNaN"](d2[0]) || Number["isNaN"](d2[1])) return null;
  const f2 = mercator2lonlat(d2);
  return a$b["defined"](e2) && (f2[2] = e2), lonlat2cartesian(f2);
}
function mercators2cartesians(d2, e2) {
  const f2 = [];
  for (let g2 = 0, h2 = d2["length"]; g2 < h2; g2++) {
    const j2 = mercator2cartesian(d2[g2], e2);
    j2 && f2["push"](j2);
  }
  return f2;
}
function mercator2lonlat(d2) {
  return mct2jwd(d2);
}
function mercators2lonlats(d2) {
  const e2 = [];
  for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
    const h2 = mercator2lonlat(d2[f2]);
    h2 && e2["push"](h2);
  }
  return e2;
}
const x_PI = 3.141592653589793 * 3e3 / 180, PI = 3.141592653589793, a = 6378245, ee = 0.006693421622965943;
function transformlng(d2, e2) {
  let f2 = 300 + d2 + 2 * e2 + 0.1 * d2 * d2 + 0.1 * d2 * e2 + 0.1 * Math["sqrt"](Math["abs"](d2));
  return f2 += (20 * Math["sin"](6 * d2 * Math["PI"]) + 20 * Math["sin"](2 * d2 * Math["PI"])) * 2 / 3, f2 += (20 * Math["sin"](d2 * Math["PI"]) + 40 * Math["sin"](d2 / 3 * Math["PI"])) * 2 / 3, f2 += (150 * Math["sin"](d2 / 12 * Math["PI"]) + 300 * Math["sin"](d2 / 30 * Math["PI"])) * 2 / 3, f2;
}
function transformlat(d2, e2) {
  let f2 = -100 + 2 * d2 + 3 * e2 + 0.2 * e2 * e2 + 0.1 * d2 * e2 + 0.2 * Math["sqrt"](Math["abs"](d2));
  return f2 += (20 * Math["sin"](6 * d2 * Math["PI"]) + 20 * Math["sin"](2 * d2 * Math["PI"])) * 2 / 3, f2 += (20 * Math["sin"](e2 * Math["PI"]) + 40 * Math["sin"](e2 / 3 * Math["PI"])) * 2 / 3, f2 += (160 * Math["sin"](e2 / 12 * Math["PI"]) + 320 * Math["sin"](e2 * Math["PI"] / 30)) * 2 / 3, f2;
}
function out_of_china(d2, e2) {
  return d2 < 72.004 || d2 > 137.8347 || e2 < 0.8293 || e2 > 55.8271;
}
function bd2gcj(d2) {
  const e2 = d2[0], f2 = d2[1], g2 = e2 - 65e-4, h2 = f2 - 6e-3, i2 = Math["sqrt"](g2 * g2 + h2 * h2) - 2e-5 * Math["sin"](h2 * x_PI), j2 = Math["atan2"](h2, g2) - 3e-6 * Math["cos"](g2 * x_PI);
  let k2 = i2 * Math["cos"](j2), l2 = i2 * Math["sin"](j2);
  return k2 = Number(k2["toFixed"](6)), l2 = Number(l2["toFixed"](6)), [k2, l2];
}
function gcj2bd(d2) {
  const e2 = d2[0], f2 = d2[1], g2 = Math["sqrt"](e2 * e2 + f2 * f2) + 2e-5 * Math["sin"](f2 * x_PI), h2 = Math["atan2"](f2, e2) + 3e-6 * Math["cos"](e2 * x_PI);
  let i2 = g2 * Math["cos"](h2) + 65e-4, j2 = g2 * Math["sin"](h2) + 6e-3;
  return i2 = Number(i2["toFixed"](6)), j2 = Number(j2["toFixed"](6)), [i2, j2];
}
function wgs2gcj(d2) {
  const e2 = d2[0], f2 = d2[1];
  if (out_of_china(e2, f2)) return [e2, f2];
  else {
    let g2 = transformlat(e2 - 105, f2 - 35), h2 = transformlng(e2 - 105, f2 - 35);
    const i2 = f2 / 180 * PI;
    let j2 = Math["sin"](i2);
    j2 = 1 - ee * j2 * j2;
    const k2 = Math["sqrt"](j2);
    g2 = g2 * 180 / (a * (1 - ee) / (j2 * k2) * PI), h2 = h2 * 180 / (a / k2 * Math["cos"](i2) * PI);
    let l2 = f2 + g2, m2 = e2 + h2;
    return m2 = Number(m2["toFixed"](6)), l2 = Number(l2["toFixed"](6)), [m2, l2];
  }
}
function gcj2wgs(d2) {
  const e2 = d2[0], f2 = d2[1];
  if (out_of_china(e2, f2)) return [e2, f2];
  else {
    let g2 = transformlat(e2 - 105, f2 - 35), h2 = transformlng(e2 - 105, f2 - 35);
    const i2 = f2 / 180 * PI;
    let j2 = Math["sin"](i2);
    j2 = 1 - ee * j2 * j2;
    const k2 = Math["sqrt"](j2);
    g2 = g2 * 180 / (a * (1 - ee) / (j2 * k2) * PI), h2 = h2 * 180 / (a / k2 * Math["cos"](i2) * PI);
    const l2 = f2 + g2, m2 = e2 + h2;
    let n2 = e2 * 2 - m2, o2 = f2 * 2 - l2;
    return n2 = Number(n2["toFixed"](6)), o2 = Number(o2["toFixed"](6)), [n2, o2];
  }
}
function bd2wgs(d2) {
  return gcj2wgs(bd2gcj(d2));
}
function wgs2bd(d2) {
  return gcj2bd(wgs2gcj(d2));
}
function jwd2mct(d2) {
  const e2 = Number(d2[0]), f2 = Number(d2[1]);
  let g2 = e2 * 2003750834e-2 / 180, h2 = Math["log"](Math["tan"]((90 + f2) * Math["PI"] / 360)) / (Math["PI"] / 180);
  return h2 = h2 * 2003750834e-2 / 180, g2 = Number(g2["toFixed"](2)), h2 = Number(h2["toFixed"](2)), [g2, h2, d2[2] || 0];
}
function mct2jwd(d2) {
  const e2 = Number(d2[0]), f2 = Number(d2[1]);
  let g2 = e2 / 2003750834e-2 * 180, h2 = f2 / 2003750834e-2 * 180;
  return h2 = 180 / Math["PI"] * (2 * Math["atan"](Math["exp"](h2 * Math["PI"] / 180)) - Math["PI"] / 2), g2 = Number(g2["toFixed"](6)), h2 = Number(h2["toFixed"](6)), [g2, h2, d2[2] || 0];
}
function proj4Trans(d2, f2, g2 = "EPSG:4326") {
  if (!f2 || !g2 || f2 == g2) return d2;
  try {
    (f2 == CRS["CGCS2000_GK_Zone_3"] || f2 == CRS["CGCS2000_GK_Zone_6"]) && (f2 = getCGCS2000EPSGByX(d2[0]));
    if (g2 == CRS["CGCS2000_GK_Zone_3"]) g2 = getCGCS2000EPSGByLng(d2[0], ![], !![]);
    else {
      if (g2 == CRS["CGCS2000_GK_Zone_6"]) g2 = getCGCS2000EPSGByLng(d2[0], !![], !![]);
      else {
        if (g2 == CRS["CGCS2000_GK_CM_3"]) g2 = getCGCS2000EPSGByLng(d2[0], ![], ![]);
        else g2 == CRS["CGCS2000_GK_CM_6"] && (g2 = getCGCS2000EPSGByLng(d2[0], !![], ![]));
      }
    }
    if (!f2 || !g2 || f2 == g2) return d2;
    const h2 = proj4(f2, g2, d2);
    if (a$b["defined"](h2) && h2["length"] > 1 && !Number["isNaN"](h2[0]) && h2[0] != Infinity) return h2;
  } catch (i2) {
  }
  return d2;
}
function proj4TransArr(d2, e2, f2 = "EPSG:4326") {
  if (!e2 || e2 == f2) return d2;
  const g2 = [];
  for (let h2 = 0, j2 = d2["length"]; h2 < j2; h2++) {
    const k2 = d2[h2];
    if (Array["isArray"](k2[0])) {
      const l2 = proj4TransArr(k2, e2, f2);
      l2 && l2["length"] > 0 && g2["push"](l2);
    } else {
      const m2 = proj4Trans(k2, e2, f2);
      m2 && g2["push"](m2);
    }
  }
  return g2;
}
const b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  bd2gcj,
  bd2wgs,
  cartesian2lonlat,
  cartesian2mercator,
  cartesians2lonlats,
  cartesians2mercators,
  degree2dms,
  dms2degree,
  gcj2bd,
  gcj2wgs,
  getCGCS2000EPSGByLng,
  getCGCS2000EPSGByX,
  jwd2mct,
  lonlat2cartesian,
  lonlat2mercator,
  lonlats2cartesians,
  lonlats2mercators,
  mct2jwd,
  mercator2cartesian,
  mercator2lonlat,
  mercators2cartesians,
  mercators2lonlats,
  proj4Trans,
  proj4TransArr,
  wgs2bd,
  wgs2gcj
}, Symbol.toStringTag, { value: "Module" }));
function setRenderErrorHandler(c2, d2) {
  c2["cesiumWidget"]["showErrorPanel"] = d2;
}
function getSurfaceHeight(c2, d2, e2 = {}) {
  if (!d2) return d2;
  const f2 = a$b["defaultValue"](e2["has3dtiles"], a$b["defined"](get3DTilesetByPosition(c2, d2)));
  return f2 ? getSurface3DTilesHeight(c2, d2, e2) : getSurfaceTerrainHeight(c2, d2, e2);
}
function get3DTilesetByPosition(c2, d2) {
  if (!d2) return null;
  d2 instanceof a$b["Cartesian3"] && (d2 = [d2]);
  for (let e2 = 0, f2 = d2["length"]; e2 < f2; ++e2) {
    const g2 = d2[e2], h2 = a$b["SceneTransforms"]["worldToWindowCoordinates"](c2["scene"], g2);
    if (!a$b["defined"](h2)) continue;
    const j2 = c2["scene"]["pick"](h2, 10, 10);
    if (a$b["defined"](j2) && a$b["defined"](j2["primitive"]) && j2["primitive"] instanceof a$b["Cesium3DTileset"]) return j2["primitive"];
  }
  return null;
}
function getSurface3DTilesHeight(c2, d2, e2 = {}) {
  e2["cartographic"] = e2["cartographic"] || a$b["Cartographic"]["fromCartesian"](d2);
  const { cartographic: f2, callback: g2 } = e2;
  if (e2["async"]) c2["scene"]["clampToHeightMostDetailed"]([d2], e2["objectsToExclude"], 0.2)["then"]((h2) => {
    const i2 = h2[0];
    if (a$b["defined"](i2)) {
      const j2 = a$b["Cartographic"]["fromCartesian"](i2), k2 = j2["height"];
      if (a$b["defined"](k2) && k2 > -1e3) {
        g2 && g2(k2, j2);
        return;
      }
    }
    getSurfaceTerrainHeight(c2, d2, e2);
  });
  else {
    const h2 = c2["scene"]["sampleHeight"](f2, e2["objectsToExclude"], 0.2);
    if (a$b["defined"](h2) && h2 > -1e3) return g2 && g2(h2, f2), h2;
  }
  return 0;
}
function getSurfaceTerrainHeight(c2, d2, e2 = {}) {
  const f2 = e2["cartographic"] || a$b["Cartographic"]["fromCartesian"](d2), { callback: g2 } = e2, h2 = Boolean(c2["scene"]["terrainProvider"]["_layers"]);
  if (!h2) return g2 && g2(0, f2), 0;
  if (e2["async"]) Promise["all"]([a$b["sampleTerrainMostDetailed"](c2["scene"]["terrainProvider"], [f2])])["then"]((i2) => {
    const j2 = i2[0];
    let k2;
    a$b["defined"](j2) && a$b["defined"](j2["height"]) ? k2 = j2["height"] : k2 = c2["scene"]["globe"]["getHeight"](f2), g2 && g2(k2, f2);
  });
  else {
    const i2 = c2["scene"]["globe"]["getHeight"](f2);
    return i2 && i2 > -1e3 ? (g2 && g2(i2, f2), i2) : f2["height"];
  }
  return 0;
}
function getCanvasCenterCoords(c2) {
  const d2 = c2["scene"]["canvas"], e2 = new a$b["Cartesian2"](d2["clientWidth"] / 2, d2["clientHeight"] / 2), f2 = c2["scene"]["camera"]["getPickRay"](e2);
  if (f2) {
    let g2 = c2["scene"]["globe"]["pick"](f2, c2["scene"]);
    !g2 && (g2 = c2["scene"]["camera"]["pickEllipsoid"](e2));
    if (g2) {
      const h2 = LatLngPoint["fromCartesian"](g2);
      return h2;
    }
  }
}
function getCurrentMousePosition(c2, d2, f2) {
  const g2 = c2["scene"];
  let h2, i2;
  try {
    i2 = g2["pick"](d2, 5, 5);
  } catch (j2) {
    handlerError("NOT_THROW", "getCurrentMousePosition: scene.pick 拾取时异常", j2);
  }
  if (g2["pickPositionSupported"] && a$b["defined"](i2)) {
    const k2 = hasPickedModel(i2, f2 == null ? void 0 : f2["noPickEntity"]);
    if (k2) {
      if (k2["billboard"] || k2["point"] || k2["label"]) return getPositionValue(k2["position"]);
      if (k2["show"]) {
        k2["show"] = ![], g2["requestRender"](), h2 = getCurrentMousePosition(c2, d2, f2), k2["show"] = !![];
        if (h2) return h2;
      }
      if ((f2 == null ? void 0 : f2["onlyPickModelPosition"]) || !g2["globe"]["show"]) return g2["pickPosition"](d2);
    } else {
      if (a$b["defined"](i2 == null ? void 0 : i2["id"])) {
        const l2 = i2 == null ? void 0 : i2["id"];
        if ((l2["billboard"] || l2["point"] || l2["label"]) && !l2["model"]) return getPositionValue(l2["position"]);
      }
      h2 = g2["pickPosition"](d2);
      if (a$b["defined"](h2)) {
        const m2 = a$b["Cartographic"]["fromCartesian"](h2);
        if (m2["height"] >= 0) return h2;
        if (!a$b["defined"](i2 == null ? void 0 : i2["id"]) && m2["height"] >= -5e3) return h2;
      }
    }
  }
  if (f2 == null ? void 0 : f2["onlyPickModelPosition"]) return h2;
  if (g2["mode"] === a$b["SceneMode"]["SCENE3D"]) {
    const n2 = g2["camera"]["getPickRay"](d2);
    n2 && (h2 = g2["globe"]["pick"](n2, g2), !h2 && (h2 = g2["camera"]["pickEllipsoid"](d2, g2["globe"]["ellipsoid"])));
  } else h2 = g2["camera"]["pickEllipsoid"](d2, g2["globe"]["ellipsoid"]);
  if (a$b["defined"](h2) && g2["camera"]["positionCartographic"]["height"] < 1e4) {
    const o2 = a$b["Cartographic"]["fromCartesian"](h2);
    if (o2["height"] < -5e3) return void 0;
  }
  return h2;
}
function getCanvasXY(c2, d2) {
  const e2 = LatLngPoint["toCartesian"](d2);
  return a$b["SceneTransforms"]["worldToWindowCoordinates"](c2["scene"], e2);
}
function getRectangle(c2, d2 = ![]) {
  for (let g2 = c2["length"] - 1; g2 >= 0; g2--) {
    !a$b["defined"](c2[g2]) && c2["splice"](g2, 1);
  }
  const e2 = LatLngArray["toCartesians"](c2), f2 = a$b["Rectangle"]["fromCartesianArray"](e2);
  return d2 ? formatRectangle(f2) : f2;
}
function formatRectangle(c2, d2 = LatLngPoint["FormatLength"]) {
  let e2 = formatNum(a$b["Math"]["toDegrees"](c2["west"]), d2), f2 = formatNum(a$b["Math"]["toDegrees"](c2["east"]), d2), g2 = formatNum(a$b["Math"]["toDegrees"](c2["north"]), d2), h2 = formatNum(a$b["Math"]["toDegrees"](c2["south"]), d2);
  return e2 > f2 && ([e2, f2] = [f2, e2]), h2 > g2 && ([h2, g2] = [g2, h2]), { "xmin": e2, "xmax": f2, "ymin": h2, "ymax": g2 };
}
function parseRectangle(c2) {
  if (c2 instanceof a$b["Rectangle"]) return c2;
  else {
    if (isArray(c2)) return a$b["Rectangle"]["fromDegrees"](c2[0], c2[1], c2[2], c2[3]);
    else {
      if (isString(c2)) {
        const d2 = c2["split"](",")["map"](Number["parseFloat"]);
        return a$b["Rectangle"]["fromDegrees"](d2[0], d2[1], d2[2], d2[3]);
      } else return a$b["defined"](c2) && a$b["defined"](c2["xmin"]) && a$b["defined"](c2["xmax"]) && a$b["defined"](c2["ymin"]) && a$b["defined"](c2["ymax"]) ? a$b["Rectangle"]["fromDegrees"](c2["xmin"], c2["ymin"], c2["xmax"], c2["ymax"]) : void 0;
    }
  }
}
function getTransFun(c2, d2) {
  if (!c2 || !d2) return ![];
  const e2 = crsName2FunName(c2), f2 = crsName2FunName(d2);
  if (e2 == f2) return ![];
  const g2 = e2 + "2" + f2;
  if (!b[g2]) return ![];
  return b[g2];
}
function crsName2FunName(c2) {
  switch (c2) {
    case ChinaCRS["WGS84"]:
      return "wgs";
    case ChinaCRS["GCJ02"]:
      return "gcj";
    case ChinaCRS["BD09"]:
      return "bd";
  }
}
function hasPickedModel(c2, d2) {
  if (a$b["defined"](c2["id"])) {
    const e2 = c2["id"];
    if (e2["_noMousePick"]) return e2;
    if (d2 && e2 === d2) return e2;
  }
  if (a$b["defined"](c2["primitive"])) {
    const f2 = c2["primitive"];
    if (f2["_noMousePick"]) return f2;
    if (d2 && f2 === d2) return f2;
  }
  if (a$b["defined"](c2["tileset"])) {
    const g2 = c2["tileset"];
    if (g2["_noMousePick"]) return g2;
    if (d2 && g2 === d2) return g2;
  }
  return void 0;
}
function getPositionValue(c2, d2) {
  if (!c2) return void 0;
  let e2;
  if (c2 instanceof a$b["Cartesian3"]) e2 = c2;
  else {
    if (c2["_value"] instanceof a$b["Cartesian3"]) e2 = c2["_value"];
    else typeof c2["getValue"] === "function" && (e2 = c2["getValue"](a$b["JulianDate"]["now"]()));
  }
  return e2;
}
function getCesiumColor(c2, d2, e2) {
  if (c2) {
    if (typeof c2 === "string") return a$b["Color"]["fromCssColorString"](c2);
    else {
      if (typeof c2 === "function") return getCesiumColor(c2(e2), d2);
      else return c2 instanceof a$b["Property"] ? getCesiumColor(c2["getValue"](a$b["JulianDate"]["now"]()), d2) : c2;
    }
  } else return d2 || a$b["Color"]["WHITE"];
}
function getCesiumValue(c2, d2, e2 = a$b["JulianDate"]["now"]()) {
  if (!c2) return c2;
  if (d2) {
    if (c2 instanceof d2) return c2;
    else {
      if (c2["_value"] && c2["_value"] instanceof d2) return c2["_value"];
    }
  }
  if (isFunction(c2)) return c2["getValue"](e2);
  return c2;
}
function getAttrVal(c2, d2) {
  if (!c2) return c2;
  try {
    c2["getValue"] && (c2 = c2["getValue"](a$b["JulianDate"]["now"]()));
    const f2 = {};
    if (c2["_propertyNames"] && c2["_propertyNames"]["length"] > 0) for (const g2 of c2["_propertyNames"]) {
      const h2 = getOneAttrValue(g2, c2[g2], d2);
      if (h2 == null) continue;
      f2[g2] = h2;
    }
    else for (const i2 in c2) {
      const j2 = getOneAttrValue(i2, c2[i2], d2);
      if (j2 == null) continue;
      f2[i2] = j2;
    }
    return f2;
  } catch (k2) {
    handlerError("NOT_THROW", "getAttrVal: 出错了", k2);
  }
  return c2;
}
function getColorByStyle(c2, d2 = a$b["Color"]["YELLOW"]) {
  let e2;
  if (c2["color"]) {
    if (isString(c2["color"])) e2 = a$b["Color"]["fromCssColorString"](c2["color"]);
    else isFunction(c2["color"]) ? e2 = c2["color"](c2) : e2 = c2["color"];
  } else c2["randomColor"] ? e2 = a$b["Color"]["fromRandom"]({ "minimumRed": a$b["defaultValue"](c2["minimumRed"], 0), "maximumRed": a$b["defaultValue"](c2["maximumRed"], 0.75), "minimumGreen": a$b["defaultValue"](c2["minimumGreen"], 0), "maximumGreen": a$b["defaultValue"](c2["maximumGreen"], 0.75), "minimumBlue": a$b["defaultValue"](c2["minimumBlue"], 0), "maximumBlue": a$b["defaultValue"](c2["maximumBlue"], 0.75) }) : e2 = d2;
  if (!a$b["defined"](e2)) return e2;
  return a$b["defined"](c2["opacity"]) && (c2["opacity"] = Math["min"](Math["max"](c2["opacity"], 0), 1), e2 = e2["withAlpha"](Number(c2["opacity"]))), e2;
}
function getTextImage(c2, d2 = {}) {
  const e2 = a$b["writeTextToCanvas"](c2, d2);
  if (e2) {
    if (d2["outlineWidth"]) {
      const f2 = e2["width"], g2 = e2["height"], h2 = e2["getContext"]("2d");
      let i2;
      if (d2["outlineColor"]) i2 = d2["outlineColor"]["toCssColorString"]();
      else d2["fillColor"] ? i2 = d2["fillColor"]["toCssColorString"]() : i2 = "#ffffff";
      const j2 = d2["outlineWidth"];
      h2["strokeStyle"] = i2, h2["lineWidth"] = j2, h2["strokeRect"](j2 / 2, j2 / 2, f2 - j2, g2 - j2);
    }
    return e2;
  } else return null;
}
function addPositionsHeight(c2, d2 = 0) {
  d2 = Number(d2);
  if (Number["isNaN"](d2) || d2 == 0) return c2;
  if (Array["isArray"](c2)) {
    const e2 = [];
    for (let f2 = 0, g2 = c2["length"]; f2 < g2; f2++) {
      const h2 = a$b["Cartographic"]["fromCartesian"](c2[f2]), j2 = a$b["Cartesian3"]["fromRadians"](h2["longitude"], h2["latitude"], h2["height"] + d2);
      e2["push"](j2);
    }
    return e2;
  } else {
    const k2 = a$b["Cartographic"]["fromCartesian"](c2);
    return a$b["Cartesian3"]["fromRadians"](k2["longitude"], k2["latitude"], k2["height"] + d2);
  }
}
function setPositionsHeight(c2, d2 = 0) {
  if (!c2) return c2;
  if (Array["isArray"](c2)) {
    const e2 = [];
    for (let f2 = 0, g2 = c2["length"]; f2 < g2; f2++) {
      const h2 = a$b["Cartographic"]["fromCartesian"](c2[f2]), j2 = a$b["Cartesian3"]["fromRadians"](h2["longitude"], h2["latitude"], d2);
      e2["push"](j2);
    }
    return e2;
  } else {
    const k2 = a$b["Cartographic"]["fromCartesian"](c2);
    return a$b["Cartesian3"]["fromRadians"](k2["longitude"], k2["latitude"], d2);
  }
}
function getOneAttrValue(c2, d2, e2) {
  if (d2 == null || d2 === "" || d2 === "Null" || d2 === "Unknown") return void 0;
  d2["getValue"] && typeof d2["getValue"] == "function" && c2 != "material" && (d2 = d2["getValue"](a$b["JulianDate"]["now"]()));
  if (isFunction(d2)) return void 0;
  if (e2) {
    if (d2 instanceof a$b["Color"]) return d2["toCssColorString"]();
    if (!isSimpleType(d2)) return void 0;
  }
  return d2;
}
const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  addPositionsHeight,
  bd2gcj,
  bd2wgs,
  cartesian2lonlat,
  cartesian2mercator,
  cartesians2lonlats,
  cartesians2mercators,
  degree2dms,
  dms2degree,
  formatRectangle,
  gcj2bd,
  gcj2wgs,
  get3DTilesetByPosition,
  getAttrVal,
  getCGCS2000EPSGByLng,
  getCGCS2000EPSGByX,
  getCanvasCenterCoords,
  getCanvasXY,
  getCesiumColor,
  getCesiumValue,
  getColorByStyle,
  getCurrentMousePosition,
  getRectangle,
  getSurface3DTilesHeight,
  getSurfaceHeight,
  getSurfaceTerrainHeight,
  getTextImage,
  getTransFun,
  jwd2mct,
  lonlat2cartesian,
  lonlat2mercator,
  lonlats2cartesians,
  lonlats2mercators,
  mct2jwd,
  mercator2cartesian,
  mercator2lonlat,
  mercators2cartesians,
  mercators2lonlats,
  parseRectangle,
  proj4Trans,
  proj4TransArr,
  setPositionsHeight,
  setRenderErrorHandler,
  wgs2bd,
  wgs2gcj
}, Symbol.toStringTag, { value: "Module" }));
const rayScratch = new a$b["Ray"](), cartesian3Scratch = new a$b["Cartesian3"]();
function isCenter(b2) {
  return b2["alt"] !== void 0 && b2["lat"] !== void 0 && b2["lng"] !== void 0;
}
function isExtent(b2) {
  return b2["xmax"] !== void 0 && b2["xmin"] !== void 0 && b2["ymin"] !== void 0 && b2["ymax"] !== void 0;
}
function cancelFlyTo(b2) {
  b2["camera"]["cancelFlight"]();
}
function flyTo(b2, c2) {
  const d2 = isCenter(c2) ? "LAT_LNG_ALT" : isExtent(c2) ? "EXTENT" : 0, e2 = d2 === "LAT_LNG_ALT" ? a$b["Cartesian3"]["fromDegrees"](c2["lng"], c2["lat"], c2["alt"]) : d2 === "EXTENT" ? a$b["Rectangle"]["fromDegrees"](c2["xmin"], c2["ymin"], c2["xmax"], c2["ymax"]) : void 0;
  if (!e2) {
    handlerError("NOT_THROW", "flyTo: 方法参数传递有误，请检查");
    return;
  }
  const f2 = { "heading": a$b["Math"]["toRadians"](c2["heading"] ?? 0), "pitch": a$b["Math"]["toRadians"](c2["pitch"] ?? -90), "roll": c2["roll"] ?? 0 };
  b2["camera"]["flyTo"]({ "destination": e2, "orientation": f2, ...c2 });
}
function flyToPoint(b2, c2, d2 = {}) {
  const e2 = LatLngPoint["parse"](c2), f2 = e2["toCartesian"]();
  if (d2["clampToGround"]) {
    getSurfaceHeight(b2, f2, { "async": !![], "has3dtiles": !![], "callback": (m2, n2) => {
      e2["alt"] = m2, delete d2["clampToGround"], flyToPoint(b2, e2, d2);
    } });
    return;
  }
  let g2 = d2["radius"] || getCameraDistance(b2) || 1e3;
  a$b["defined"](d2["scale"]) && d2["scale"] > 0 && (g2 *= d2["scale"]);
  a$b["defined"](d2["minHeight"]) && g2 < d2["minHeight"] && (g2 = d2["minHeight"]);
  a$b["defined"](d2["maxHeight"]) && g2 > d2["maxHeight"] && (g2 = d2["maxHeight"]);
  let h2 = a$b["defined"](d2["pitch"]) ? a$b["Math"]["toRadians"](d2["pitch"]) : b2["camera"]["pitch"];
  const i2 = a$b["Math"]["toDegrees"](h2);
  a$b["defined"](d2["minPitch"]) && i2 < d2["minPitch"] && (h2 = a$b["Math"]["toRadians"](d2["minPitch"]));
  a$b["defined"](d2["maxPitch"]) && i2 > d2["maxPitch"] && (h2 = a$b["Math"]["toRadians"](d2["maxPitch"]));
  const j2 = a$b["defined"](d2["heading"]) ? a$b["Math"]["toRadians"](d2["heading"]) : b2["camera"]["heading"], k2 = new a$b["HeadingPitchRange"](j2, h2, g2), l2 = new a$b["BoundingSphere"](f2, 0);
  d2["duration"] === 0 ? (b2["camera"]["lookAt"](f2, k2), d2["complete"] && d2["complete"]()) : b2["camera"]["flyToBoundingSphere"](l2, { ...d2, "offset": k2 });
}
function flyToExtent(b2, c2, d2 = {}) {
  const e2 = c2["xmin"] ?? 0, f2 = c2["xmax"] ?? 0, g2 = c2["ymin"] ?? 0, h2 = c2["ymax"] ?? 0, i2 = (e2 + f2) / 2 || defaultViewCenter[0], j2 = (g2 + h2) / 2 || defaultViewCenter[1], k2 = a$b["Rectangle"]["fromDegrees"](e2, g2, f2, h2), l2 = Math["min"](Math["PI"], Math["max"](k2["height"], k2["width"])), m2 = { ...d2 };
  l2 > 0 && (m2["radius"] = a$b["defaultValue"](m2["radius"], 0) + a$b["Math"]["chordLength"](l2, b2["scene"]["globe"]["ellipsoid"]["maximumRadius"]));
  let n2 = a$b["defaultValue"](c2["height"], 0);
  n2 == 0 && (n2 = getSurfaceHeight(b2, a$b["Cartesian3"]["fromDegrees"](i2, j2))), flyToPoint(b2, new LatLngPoint(i2, j2, n2), m2);
}
function flyToPositions(b2, c2, d2 = {}) {
  if (c2["length"] == 1) {
    flyToPoint(b2, c2[0], d2);
    return;
  }
  const e2 = getRectangle(c2, !![]);
  e2["height"] = getMaxHeight(c2);
  if (!e2) return;
  e2["xmin"] == e2["xmax"] || e2["ymin"] == e2["ymax"] || e2["xmax"] - e2["xmin"] > 200 ? flyToPoint(b2, [e2["xmin"], e2["ymin"], e2["height"] ?? 0], d2) : flyToExtent(b2, e2, d2);
}
function getMaxHeight(b2, c2 = 0) {
  if (b2 == null || b2["length"] == 0) return c2;
  let d2 = c2;
  for (let e2 = 0; e2 < b2["length"]; e2++) {
    const f2 = a$b["Cartographic"]["fromCartesian"](b2[e2]);
    e2 == 0 && (d2 = f2["height"]), f2["height"] > d2 && (d2 = f2["height"]);
  }
  return formatNum(d2, LatLngPoint["FormatAltLength"]);
}
function getCameraDistance(b2) {
  const c2 = getCanvasCenterCoords(b2);
  if (c2) {
    const d2 = a$b["Cartesian3"]["distance"](c2["toCartesian"](), b2["camera"]["positionWC"]);
    return d2;
  } else return 0;
}
function getCameraView(b2, c2) {
  const d2 = b2["camera"]["positionCartographic"], e2 = {}, { FormatLength: f2, FormatAltLength: g2 } = LatLngPoint;
  return e2["lat"] = formatNum(a$b["Math"]["toDegrees"](d2["latitude"]), f2), e2["lng"] = formatNum(a$b["Math"]["toDegrees"](d2["longitude"]), f2), c2 ? (e2["alt"] = formatNum(d2["height"], 0), e2["heading"] = formatNum(a$b["Math"]["toDegrees"](b2["camera"]["heading"] || 0) % 360, 0), e2["pitch"] = formatNum(a$b["Math"]["toDegrees"](b2["camera"]["pitch"] || 0) % 360, 0), e2["roll"] = formatNum(a$b["Math"]["toDegrees"](b2["camera"]["roll"] || 0) % 360, 0)) : (e2["alt"] = formatNum(d2["height"], g2), e2["heading"] = formatNum(a$b["Math"]["toDegrees"](b2["camera"]["heading"] || 0) % 360, 1), e2["pitch"] = formatNum(a$b["Math"]["toDegrees"](b2["camera"]["pitch"] || 0) % 360, 1), e2["roll"] = formatNum(a$b["Math"]["toDegrees"](b2["camera"]["roll"] || 0) % 360, 1)), e2;
}
function getExtent(b2, c2 = LatLngPoint["FormatLength"]) {
  const d2 = formatRectangle(a$b["Camera"]["DEFAULT_VIEW_RECTANGLE"]), e2 = b2["scene"]["globe"]["ellipsoid"], f2 = b2["scene"]["canvas"], g2 = b2["camera"]["pickEllipsoid"](new a$b["Cartesian2"](0, 0), e2);
  if (g2) {
    const i2 = e2["cartesianToCartographic"](g2);
    d2["xmin"] = a$b["Math"]["toDegrees"](i2["longitude"]), d2["ymax"] = a$b["Math"]["toDegrees"](i2["latitude"]);
  } else {
    const j2 = f2["width"] / 2, k2 = f2["height"] / 2;
    for (let l2 = 0; l2 <= j2; l2 += 10) {
      const m2 = b2["camera"]["pickEllipsoid"](new a$b["Cartesian2"](l2, k2), e2);
      if (m2) {
        const n2 = e2["cartesianToCartographic"](m2);
        d2["xmin"] = a$b["Math"]["toDegrees"](n2["longitude"]);
        break;
      }
    }
    for (let o2 = 0; o2 <= k2; o2 += 10) {
      const p2 = b2["camera"]["pickEllipsoid"](new a$b["Cartesian2"](j2, o2), e2);
      if (p2) {
        const q2 = e2["cartesianToCartographic"](p2);
        d2["ymax"] = a$b["Math"]["toDegrees"](q2["latitude"]);
        break;
      }
    }
  }
  const h2 = b2["camera"]["pickEllipsoid"](new a$b["Cartesian2"](f2["width"], f2["height"]), e2);
  if (h2) {
    const r2 = e2["cartesianToCartographic"](h2);
    d2["xmax"] = a$b["Math"]["toDegrees"](r2["longitude"]), d2["ymin"] = a$b["Math"]["toDegrees"](r2["latitude"]);
  } else {
    const s2 = f2["width"] / 2, t2 = f2["height"] / 2;
    for (let u2 = f2["width"]; u2 >= s2; u2 -= 10) {
      const v2 = b2["camera"]["pickEllipsoid"](new a$b["Cartesian2"](u2, t2), e2);
      if (v2) {
        const w2 = e2["cartesianToCartographic"](v2);
        d2["xmax"] = a$b["Math"]["toDegrees"](w2["longitude"]);
        break;
      }
    }
    for (let x2 = f2["height"]; x2 >= t2; x2 -= 10) {
      const y2 = b2["camera"]["pickEllipsoid"](new a$b["Cartesian2"](s2, x2), e2);
      if (y2) {
        const z2 = e2["cartesianToCartographic"](y2);
        d2["ymin"] = a$b["Math"]["toDegrees"](z2["latitude"]);
        break;
      }
    }
  }
  if (d2["xmax"] < d2["xmin"]) {
    const A5 = d2["xmax"];
    d2["xmax"] = d2["xmin"], d2["xmin"] = A5;
  }
  if (d2["ymax"] < d2["ymin"]) {
    const B2 = d2["ymax"];
    d2["ymax"] = d2["ymin"], d2["ymin"] = B2;
  }
  return formatRectangle(a$b["Rectangle"]["fromDegrees"](d2["xmin"], d2["ymin"], d2["xmax"], d2["ymax"]), c2);
}
function zoomIn(b2, c2 = 1.5) {
  return c2 = 1 / c2, zoom(b2, c2);
}
function zoomOut(b2, c2 = 1.5) {
  return zoom(b2, c2);
}
function zoom(b2, c2) {
  const d2 = b2["scene"], e2 = d2["screenSpaceCameraController"];
  if (!e2["enableInputs"] || !e2["enableZoom"]) return ![];
  const f2 = d2["camera"];
  let g2;
  switch (d2["mode"]) {
    case a$b["SceneMode"]["MORPHING"]:
      return ![];
    case a$b["SceneMode"]["SCENE2D"]:
      f2["zoomIn"](f2["positionCartographic"]["height"] * (1 - c2));
      return !![];
    default: {
      let h2;
      a$b["defined"](b2["trackedEntity"]) ? h2 = new a$b["Cartesian3"]() : (rayScratch["origin"] = f2["positionWC"], rayScratch["direction"] = f2["directionWC"], h2 = d2["globe"]["pick"](rayScratch, d2, new a$b["Cartesian3"]()), a$b["defined"](h2) && (h2 = f2["worldToCameraCoordinatesPoint"](h2, h2)));
      if (!a$b["defined"](h2)) {
        const o2 = new a$b["Ray"](f2["worldToCameraCoordinatesPoint"](d2["globe"]["ellipsoid"]["cartographicToCartesian"](f2["positionCartographic"])), f2["directionWC"]);
        h2 = a$b["IntersectionTests"]["grazingAltitudeLocation"](o2, d2["globe"]["ellipsoid"]);
        if (!a$b["defined"](h2)) return ![];
        g2 = { "heading": f2["heading"], "pitch": f2["pitch"], "roll": f2["roll"] };
      } else g2 = { "direction": f2["direction"], "up": f2["up"] };
      const i2 = a$b["Cartesian3"]["subtract"](f2["position"], h2, cartesian3Scratch), j2 = a$b["Cartesian3"]["multiplyByScalar"](i2, c2, i2), k2 = a$b["Cartesian3"]["add"](h2, j2, h2);
      if (!a$b["defined"](k2)) return ![];
      const l2 = e2["minimumZoomDistance"], m2 = e2["maximumZoomDistance"], n2 = a$b["Cartographic"]["fromCartesian"](k2)["height"];
      if (n2 < l2) return ![];
      if (n2 < e2["minimumCollisionTerrainHeight"]) {
        const p2 = e2["_scene"]["globeHeight"];
        if (a$b["defined"](p2) && n2 <= p2 + l2) return ![];
      }
      if (m2 && n2 > m2) return ![];
      return a$b["defined"](b2["trackedEntity"]) || d2["mode"] == a$b["SceneMode"]["COLUMBUS_VIEW"] ? f2["position"] = k2 : f2["flyTo"]({ "destination": k2, "orientation": g2, "duration": 0.5, "convert": ![] }), !![];
    }
  }
}
const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  cancelFlyTo,
  flyTo,
  flyToExtent,
  flyToPoint,
  flyToPositions,
  getCameraDistance,
  getCameraView,
  getExtent,
  getMaxHeight,
  isCenter,
  isExtent,
  zoomIn,
  zoomOut
}, Symbol.toStringTag, { value: "Module" }));
function addButton(a2, b2, c2) {
  let d2;
  !isArray(b2) ? d2 = [b2] : d2 = b2;
  let e2;
  d2["forEach"]((f2) => {
    const g2 = createDom("button", "cesium-button cesium-toolbar-button " + f2["uuid"]);
    g2["id"] = "button_" + f2["uuid"], g2["style"]["display"] = "inline-block", g2["setAttribute"]("title", f2["title"]);
    const h2 = parseDom(f2["icon"], ![])[0];
    h2["classList"]["add"]("cesium-svgPath-svg"), g2["appendChild"](h2), g2["addEventListener"]("click", (j2) => {
      var _a;
      (_a = f2["onClick"]) == null ? void 0 : _a.call(f2, a2);
    });
    let i2 = document["getElementsByClassName"]("cesium-viewer-toolbar")[0];
    (c2 == null ? void 0 : c2["customContainer"]) && (i2 = c2 == null ? void 0 : c2["customContainer"]);
    if (isNumber(c2 == null ? void 0 : c2["insertIndex"])) {
      const j2 = i2["childNodes"];
      j2["length"] < c2["insertIndex"] && (c2["insertIndex"] = 0), e2 ? i2["insertBefore"](g2, e2) : (i2["insertBefore"](g2, j2[c2["insertIndex"]]), e2 = g2);
    } else i2["appendChild"](g2);
  });
}
function removeButton(a2) {
  var _a;
  (_a = document["querySelector"]("." + a2)) == null ? void 0 : _a["remove"]();
}
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  addButton,
  removeButton
}, Symbol.toStringTag, { value: "Module" }));
function guid(a2 = 2) {
  const b2 = (Date["now"]() * 3)["toString"](16), c2 = (/* @__PURE__ */ new Date())["getTimezoneOffset"](), d2 = Number((c2 < 0 ? "7" : "6") + Math["abs"](c2))["toString"](16), e2 = a2 * 9 + 3 + 15;
  let f2 = "";
  for (let g2 = 0; g2 < a2; g2++) f2 += randomBlock() + "-";
  f2 += d2, f2 += b2;
  while (f2["length"] < e2) f2 += randomBlock();
  return f2["substring"](0, e2);
}
function isGuid(a2, b2 = 2) {
  const c2 = a2["split"]("-"), d2 = isNumber(c2[c2["length"] - 1]);
  if (c2["length"] - 1 !== b2) return "Invalid guid, invalid number of blocks";
  const e2 = c2["concat"]()["slice"](0, -1)["reduce"]((f2, g2) => {
    return f2 && g2["length"] === 8 && !g2["includes"](" ");
  }, !![]);
  if (!e2) return "Invalid guid, one or more random blocks are invalid";
  if (!d2 && c2[c2["length"] - 1]["length"] !== 18) return "Invalid guid, last date block has invalid size";
  return !![];
}
function shortGuid() {
  return guid(1)["replace"]("-", "");
}
function isShortGuid(a2) {
  const b2 = /^[a-z0-9]+$/i;
  if (a2["length"] !== 26) return "Should be 26 characters long";
  if (!b2["test"](a2)) return "Should be only alphanumeric";
  return "";
}
function randomBlock() {
  return Number(Math["random"]()["toString"]()["substring"](2))["toString"](16)["substring"](0, 8);
}
function loopArrayCallback(a2, b2) {
  if (!a2) return;
  if (Array["isArray"](a2)) {
    const c2 = [];
    for (let d2 = 0, e2 = a2["length"]; d2 < e2; d2++) {
      c2["push"](b2(a2[d2]));
    }
    return c2;
  } else return b2(a2);
}
function deepMerge(a2, b2, c2) {
  const d2 = Array["isArray"](b2);
  return d2 ? Array["isArray"](a2) ? defaultArrayMerge(a2, b2, c2) : cloneIfNecessary(b2, c2) : mergeObject(a2, b2, c2);
}
function deepMergeAll(a2, b2) {
  if (!Array["isArray"](a2) || a2["length"] < 2) throw new Error("first argument should be an array with at least two elements");
  return a2["reduce"]((c2, d2) => {
    return deepMerge(c2, d2, b2);
  });
}
function emptyTarget(a2) {
  return Array["isArray"](a2) ? [] : {};
}
function cloneIfNecessary(a2, b2) {
  const c2 = b2 && b2["clone"] === !![];
  return c2 && isMergeableObject(a2) ? deepMerge(emptyTarget(a2), a2, b2) : a2;
}
function defaultArrayMerge(a2, b2, c2) {
  const d2 = a2["slice"]();
  return b2["forEach"]((f2, g2) => {
    if (typeof d2[g2] === "undefined") d2[g2] = cloneIfNecessary(f2, c2);
    else {
      if (isMergeableObject(f2)) d2["push"](cloneIfNecessary(f2, c2));
      else !a2["includes"](f2) && d2["push"](cloneIfNecessary(f2, c2));
    }
  }), d2;
}
function mergeObject(a2, b2, c2) {
  const d2 = {};
  return isMergeableObject(a2) && Object["keys"](a2)["forEach"]((e2) => {
    d2[e2] = cloneIfNecessary(a2[e2], c2);
  }), Object["keys"](b2)["forEach"]((e2) => {
    !isMergeableObject(b2[e2]) || !a2[e2] ? d2[e2] = cloneIfNecessary(b2[e2], c2) : d2[e2] = deepMerge(a2[e2], b2[e2], c2);
  }), d2;
}
class SmallTooltip extends BaseClass {
  constructor(c2, d2 = {}) {
    super(d2);
    __publicField(this, "_viewer");
    __publicField(this, "_id");
    __publicField(this, "_direction");
    __publicField(this, "_enable");
    __publicField(this, "_handler");
    __publicField(this, "_container");
    __publicField(this, "_containerArrow");
    __publicField(this, "_containerContent");
    __publicField(this, "_currentWindowPosition");
    __publicField(this, "options");
    this["options"] = d2, this["_viewer"] = c2, this["_id"] = a$b["defaultValue"](d2["id"], this["uuid"]), this["_direction"] = a$b["defaultValue"](d2["direction"], "right"), this["_enable"] = a$b["defaultValue"](d2["enable"], ![]), this["_initContainer"](), this["_bindMousemoveEventHandler"]();
  }
  get ["id"]() {
    return this["_id"];
  }
  get ["container"]() {
    return this["_container"];
  }
  get ["viewerContainer"]() {
    var _a;
    return (_a = this["_viewer"]) == null ? void 0 : _a["container"];
  }
  get ["direction"]() {
    return this["_direction"];
  }
  set ["direction"](c2) {
    this["_direction"] = c2, this["_setDivPosition"]();
  }
  get ["currentWindowPosition"]() {
    return this["_currentWindowPosition"];
  }
  set ["currentWindowPosition"](c2) {
    this["_currentWindowPosition"] = c2, this["_setDivPosition"]();
  }
  get ["enable"]() {
    return this["_enable"];
  }
  set ["enable"](c2) {
    this["_enable"] = c2, this["_container"] && (this["_container"]["style"]["display"] = this["_enable"] ? "block" : "none");
  }
  ["_setDivPosition"]() {
    if (!this["_currentWindowPosition"]) return;
    this["_container"]["style"]["display"] = "block", this["_container"]["style"]["top"] = this["_currentWindowPosition"]["y"] - this["_container"]["clientHeight"] / 2 + "px";
    if (this["direction"] == "right") this["_container"]["style"]["left"] = this["_currentWindowPosition"]["x"] + 25 + "px", addClass(this["_containerArrow"], "pie3d-smallTooltip-rightArrow"), removeClass(this["_containerArrow"], "pie3d-smallTooltip-leftArrow");
    else this["direction"] == "left" && (this["_container"]["style"]["left"] = this["_currentWindowPosition"]["x"] - this["_container"]["clientWidth"] - 25 + "px", addClass(this["_containerArrow"], "pie3d-smallTooltip-leftArrow"), removeClass(this["_containerArrow"], "pie3d-smallTooltip-rightArrow"));
  }
  ["_initContainer"]() {
    this["_container"] = createDom("div", "pie3d-smallTooltip"), this["_container"]["setAttribute"]("uuid", this["uuid"]), this["_container"]["setAttribute"]("id", "pie3d-smallTooltip-" + this["id"]), this["_container"]["style"]["display"] = "none", this["_containerArrow"] = createDom("div", "pie3d-smallTooltip-arrow pie3d-smallTooltip-rightArrow", this["_container"]), this["_containerContent"] = createDom("div", "pie3d-smallTooltip-inner", this["_container"]), this["_container"]["addEventListener"]("click", (c2) => {
      this["close"]();
    }), this["viewerContainer"]["appendChild"](this["_container"]);
  }
  ["_bindMousemoveEventHandler"]() {
    this["_handler"] = new a$b["ScreenSpaceEventHandler"](this["_viewer"]["canvas"]), this["_handler"]["setInputAction"]((c2) => {
      const d2 = getCurrentMousePosition(this["_viewer"], c2["endPosition"]);
      c2["cartesian"] = d2, this["_mousemoveEventHandler"](c2);
    }, a$b["ScreenSpaceEventType"]["MOUSE_MOVE"]);
  }
  ["_unbindMousemoveEventHandler"]() {
    var _a;
    (_a = this["_handler"]) == null ? void 0 : _a["removeInputAction"](a$b["ScreenSpaceEventType"]["MOUSE_MOVE"]);
  }
  ["_mousemoveEventHandler"](c2) {
    this["_enable"] && (this["currentWindowPosition"] = a$b["SceneTransforms"]["worldToWindowCoordinates"](this["_viewer"]["scene"], c2["cartesian"]) ?? a$b["Cartesian2"]["ZERO"]);
  }
  ["open"](c2, d2) {
    !this["_container"] && this["_initContainer"]();
    c2 && this["_containerContent"] && (this["_containerContent"]["innerHTML"] = c2);
    this["_container"]["style"]["display"] = "block";
    if (d2 instanceof a$b["Cartesian3"]) this["currentWindowPosition"] = a$b["SceneTransforms"]["worldToWindowCoordinates"](this["_viewer"]["scene"], d2) ?? a$b["Cartesian2"]["ZERO"];
    else {
      if (d2 instanceof a$b["Cartesian2"]) {
        const e2 = new a$b["Cartesian3"](d2["x"], d2["y"], 0);
        this["currentWindowPosition"] = a$b["SceneTransforms"]["worldToWindowCoordinates"](this["_viewer"]["scene"], e2) ?? a$b["Cartesian2"]["ZERO"];
      } else this["currentWindowPosition"] = this["currentWindowPosition"] ?? a$b["Cartesian2"]["ZERO"];
    }
  }
  ["close"]() {
    this["_container"] && (this["_container"]["style"]["display"] = "none");
  }
  ["destroy"]() {
    var _a;
    this["_container"] && this["_container"]["parentNode"] && this["viewerContainer"]["removeChild"](this["_container"]), this["_unbindMousemoveEventHandler"](), (_a = this["_handler"]) == null ? void 0 : _a["destroy"](), super["destroy"]();
  }
}
const DEFAULT_CONFIG = { "id": "id", "children": "children", "pid": "pid" };
function listToTree(a2, b2 = {}) {
  const c2 = getConfig(b2), d2 = /* @__PURE__ */ new Map(), e2 = [], { id: f2, children: g2, pid: h2 } = c2;
  for (const i2 of a2) {
    i2[g2] = i2[g2] || [], d2["set"](i2[f2], i2);
  }
  for (const j2 of a2) {
    const k2 = d2["get"](j2[h2]);
    (k2 ? k2["children"] : e2)["push"](j2);
  }
  return e2;
}
function treeToList(a2, b2 = {}) {
  b2 = getConfig(b2);
  const { children: c2 } = b2, d2 = [], e2 = (f2) => {
    for (const g2 of f2) {
      d2["push"](g2);
      if (g2[c2]) e2(g2[c2]);
    }
  };
  return e2(a2), d2;
}
function findNode(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const { children: d2 } = c2, e2 = [...a2];
  for (const f2 of e2) {
    if (b2(f2)) return f2;
    f2[d2] && e2["push"](...f2[d2]);
  }
}
function findNodeAll(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const { children: d2 } = c2, e2 = [...a2], f2 = [];
  for (const g2 of e2) {
    b2(g2) && f2["push"](g2), g2[d2] && e2["push"](...g2[d2]);
  }
  return f2;
}
function findPath(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = [], e2 = [...a2], f2 = /* @__PURE__ */ new Set(), { children: g2 } = c2;
  while (e2["length"]) {
    const h2 = e2[0];
    if (f2["has"](h2)) d2["pop"](), e2["shift"]();
    else {
      f2["add"](h2), h2[g2] && e2["unshift"](...h2[g2]), d2["push"](h2);
      if (b2(h2)) return d2;
    }
  }
  return null;
}
function findPathAll(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = [], e2 = [...a2], f2 = [], g2 = /* @__PURE__ */ new Set(), { children: h2 } = c2;
  while (e2["length"]) {
    const i2 = e2[0];
    g2["has"](i2) ? (d2["pop"](), e2["shift"]()) : (g2["add"](i2), i2[h2] && e2["unshift"](...i2[h2]), d2["push"](i2), b2(i2) && f2["push"]([...d2]));
  }
  return f2;
}
function filterTree(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = c2["children"];
  function e2(f2) {
    return f2["map"]((g2) => ({ ...g2 }))["filter"]((g2) => {
      return g2[d2] = g2[d2] && e2(g2[d2]), b2(g2) || g2[d2] && g2[d2]["length"];
    });
  }
  return e2(a2);
}
function forEachTree(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = [...a2], { children: e2 } = c2;
  for (let f2 = 0; f2 < d2["length"]; f2++) {
    if (b2(d2[f2])) return;
    e2 && d2[f2][e2] && d2["splice"](f2 + 1, 0, ...d2[f2][e2]);
  }
}
function treeMap(a2, b2) {
  return a2["map"]((c2) => treeMapEach(c2, b2));
}
function getConfig(a2) {
  return Object["assign"]({}, DEFAULT_CONFIG, a2);
}
function treeMapEach(a2, { children = "children", conversion: b2 }) {
  const c2 = Array["isArray"](a2[children]) && a2[children]["length"] > 0, d2 = b2(a2) || {};
  return c2 ? { ...d2, [children]: a2[children]["map"]((e2) => treeMapEach(e2, { "children": children, "conversion": b2 })) } : { ...d2 };
}
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseClass,
  LatLngPoint,
  Popup,
  SmallTooltip,
  addClass,
  camera: index$6,
  createDom,
  createSvg,
  createVideo,
  deepClone,
  deepMerge,
  deepMergeAll,
  empty,
  enterFullscreen,
  exitFullscreen,
  filterTree,
  findNode,
  findNodeAll,
  findPath,
  findPathAll,
  forEachTree,
  formatNum,
  get: get$1,
  getClass,
  getStyle,
  guid,
  hasClass,
  isArray,
  isBoolean,
  isDark,
  isDate,
  isDef,
  isElement,
  isEmpty,
  isFunction,
  isGuid,
  isImgPath,
  isMap,
  isMergeableObject,
  isNumber,
  isObject,
  isPromise,
  isRegExp,
  isShortGuid,
  isSimpleType,
  isString,
  isUnDef,
  isUrl,
  isWindow,
  layer: index$9,
  listToTree,
  loopArrayCallback,
  map: index$7,
  material: index$a,
  parseDom,
  remove,
  removeClass,
  setClass,
  shortGuid,
  template,
  treeMap,
  treeToList,
  widget: index$5
}, Symbol.toStringTag, { value: "Module" }));
function callWithErrorHandling(a2, b2, c2, ...d2) {
  try {
    return d2 ? c2(...d2) : c2();
  } catch (e2) {
    handlerError(a2, b2, e2);
  }
}
function handlerError(a2, b2, c2) {
  const d2 = isArray(b2) ? b2[0] : b2, e2 = isArray(b2) ? b2["slice"](1) : [], f2 = ["[PIE3D warn]: “" + d2 + "”.", ...e2, c2 == null ? void 0 : c2["message"]];
  console["warn"](...f2);
  if (a2 === "THROW" && c2) throw c2;
}
function handlerInfo(a2) {
  const b2 = isArray(a2) ? a2[0] : a2, c2 = isArray(a2) ? a2["slice"](1) : [], d2 = ["[PIE3D Info]: “" + b2 + "”.", ...c2];
  console["log"](...d2);
}
const DEF_OPTIONS = { "enabledMoveHandler": !![], "moveDelay": 30, "pickWidth": 4, "pickHeight": 4, "pickLimit": 9 };
class MouseEvent {
  constructor(b2, c2 = { "enabledMoveHandler": !![], "moveDelay": 30, "pickWidth": 4, "pickHeight": 4, "pickLimit": 9 }) {
    __publicField(this, "earth");
    __publicField(this, "viewer");
    __publicField(this, "options");
    __publicField(this, "handler");
    __publicField(this, "_enabledMoveHandler");
    __publicField(this, "_lastPickedInfo");
    __publicField(this, "_moveDelayTik");
    __publicField(this, "_lastMouseOverItem");
    c2 = { ...DEF_OPTIONS, ...c2 }, this["earth"] = b2, this["viewer"] = b2["viewer"], this["options"] = c2, this["_enabledMoveHandler"] = Boolean(c2["enabledMoveHandler"]), this["_setInputAction"]();
  }
  get ["enabledMoveHandler"]() {
    return this["_enabledMoveHandler"];
  }
  set ["enabledMoveHandler"](b2) {
    this["_enabledMoveHandler"] = b2, this["_moveDelayTik"] && (clearTimeout(this["_moveDelayTik"]), this["_moveDelayTik"] = void 0);
  }
  ["_setInputAction"]() {
    this["handler"] = new a$b["ScreenSpaceEventHandler"](this["viewer"]["canvas"]), this["handler"]["setInputAction"]((b2) => {
      this["_clickHandler"](b2);
    }, a$b["ScreenSpaceEventType"]["LEFT_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      this["earth"]["emit"](EventType["dblClick"], b2);
    }, a$b["ScreenSpaceEventType"]["LEFT_DOUBLE_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, [EventType["leftDown"], EventType["mouseDown"]]);
    }, a$b["ScreenSpaceEventType"]["LEFT_DOWN"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, [EventType["leftUp"], EventType["mouseUp"]]);
    }, a$b["ScreenSpaceEventType"]["LEFT_UP"]), this["handler"]["setInputAction"]((b2) => {
      const c2 = getCurrentMousePosition(this["viewer"], b2["endPosition"]);
      b2["cartesian"] = c2, this["_enabledMoveHandler"] && (this["_moveDelayTik"] && (clearTimeout(this["_moveDelayTik"]), this["_moveDelayTik"] = void 0), this["options"]["moveDelay"] !== void 0 && this["options"]["moveDelay"] > 0 ? this["_moveDelayTik"] = setTimeout((d2) => {
        this["_moveDelayTik"] = void 0, this["_mouseMoveHandler"](b2);
      }, this["options"]["moveDelay"]) : this["_mouseMoveHandler"](b2)), this["earth"]["emit"](EventType["mouseMove"], { ...b2, "cartesian": c2, "windowPosition": b2["endPosition"] });
    }, a$b["ScreenSpaceEventType"]["MOUSE_MOVE"]), this["handler"]["setInputAction"]((b2) => {
      this["earth"]["emit"](EventType["wheel"], b2);
    }, a$b["ScreenSpaceEventType"]["WHEEL"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, EventType["rightClick"]);
    }, a$b["ScreenSpaceEventType"]["RIGHT_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, [EventType["rightDown"], EventType["mouseDown"]]);
    }, a$b["ScreenSpaceEventType"]["RIGHT_DOWN"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, [EventType["rightUp"], EventType["mouseUp"]]);
    }, a$b["ScreenSpaceEventType"]["RIGHT_UP"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, EventType["middleClick"]);
    }, a$b["ScreenSpaceEventType"]["MIDDLE_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, [EventType["middleDown"], EventType["mouseDown"]]);
    }, a$b["ScreenSpaceEventType"]["MIDDLE_DOWN"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, [EventType["middleUp"], EventType["mouseUp"]]);
    }, a$b["ScreenSpaceEventType"]["MIDDLE_UP"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, EventType["pinchStart"]);
    }, a$b["ScreenSpaceEventType"]["PINCH_START"]), this["handler"]["setInputAction"]((b2) => {
      this["_globeMouseHandler"](b2, EventType["pinchEnd"]);
    }, a$b["ScreenSpaceEventType"]["PINCH_END"]), this["handler"]["setInputAction"]((b2) => {
      this["earth"]["emit"](EventType["pinchMove"], b2);
    }, a$b["ScreenSpaceEventType"]["PINCH_MOVE"]), this["viewer"]["canvas"]["addEventListener"]("keydown", this["_onKeyDown"]["bind"](this)), this["viewer"]["canvas"]["addEventListener"]("keyup", this["_onKeyUp"]["bind"](this));
  }
  ["_onKeyDown"](b2) {
    this["earth"]["emit"](EventType["keydown"], { "ctrlKey": b2["ctrlKey"], "altKey": b2["altKey"], "metaKey": b2["metaKey"], "shiftKey": b2["shiftKey"], "code": b2["code"], "key": b2["key"], "keyCode": b2["keyCode"] });
  }
  ["_onKeyUp"](b2) {
    this["earth"]["emit"](EventType["keyup"], { "ctrlKey": b2["ctrlKey"], "altKey": b2["altKey"], "metaKey": b2["metaKey"], "shiftKey": b2["shiftKey"], "code": b2["code"], "key": b2["key"], "keyCode": b2["keyCode"] });
  }
  ["_clickHandler"](b2) {
    if (!b2 || !b2["position"]) return ![];
    const c2 = b2["position"], d2 = this["_getPickTarget"](c2, b2);
    d2["sourceTarget"] ? (this["_fireTargetEvent"](EventType["click"], d2), this["earth"]["emit"](EventType["clickGraphic"], d2)) : (this["earth"]["emit"](EventType["click"], d2), this["earth"]["emit"](EventType["clickMap"], d2), this["_getPickImageryLayerFeatures"](c2, d2));
  }
  ["_globeMouseHandler"](b2, c2) {
    if (!b2 || !b2["position"]) return ![];
    const d2 = b2["position"], e2 = this["_getPickTarget"](d2, b2);
    Array["isArray"](c2) ? c2["forEach"]((f2) => {
      e2["sourceTarget"] ? this["_fireTargetEvent"](f2, e2) : this["earth"]["emit"](f2, e2);
    }) : e2["sourceTarget"] ? this["_fireTargetEvent"](c2, e2) : this["earth"]["emit"](c2, e2);
  }
  ["_mouseMoveHandler"](b2) {
    if (!b2 || !b2["endPosition"]) return ![];
    const c2 = this["_getPickTarget"](b2["endPosition"], b2), d2 = c2["sourceTarget"];
    d2 && !d2["noMouseMove"] ? this["_activateMouseOver"](c2) : this["_activateMouseOut"](), this["earth"]["emit"](EventType["mouseMoveTarget"], { ...b2, ...c2 });
  }
  ["_getPickTarget"](b2, c2) {
    let d2;
    try {
      d2 = this["viewer"]["scene"]["pick"](b2, this["options"]["pickWidth"], this["options"]["pickHeight"]);
    } catch (h2) {
    }
    let f2 = c2 == null ? void 0 : c2["cartesian"];
    !f2 && (f2 = getCurrentMousePosition(this["viewer"], b2));
    if (this["_lastPickedInfo"] && d2 && this["_lastPickedInfo"]["pickedObject"] === d2) return { ...c2, ...this["_lastPickedInfo"], "cartesian": f2, "windowPosition": b2 };
    let g2 = this["_getTargetInfo"](d2);
    if (d2 && this["_allowDrillPick"](g2)) {
      const i2 = this["viewer"]["scene"]["drillPick"](b2, this["options"]["pickLimit"], this["options"]["pickWidth"], this["options"]["pickHeight"]);
      if (i2 && i2["length"] > 0) for (let j2 = 0; j2 < i2["length"]; j2++) {
        const k2 = i2[j2];
        if (d2 === k2) continue;
        const l2 = this["_getTargetInfo"](k2);
        if (this["_allowDrillPick"](l2)) continue;
        else {
          g2 = l2;
          break;
        }
      }
    }
    return this["_lastPickedInfo"] = g2, { ...c2, ...g2, "cartesian": f2, "windowPosition": b2 };
  }
  ["_getTargetInfo"](b2) {
    if (!a$b["defined"](b2)) return {};
    let c2, d2, e2;
    if (b2 instanceof a$b["Cesium3DTileFeature"]) {
      c2 = b2;
      const f2 = b2["tileset"];
      d2 = this["earth"]["getLayerById"](f2["_pie3d_layerId"]);
      const g2 = {}, h2 = b2["getPropertyIds"]();
      for (let j2 = 0; j2 < h2["length"]; j2++) {
        const k2 = h2[j2];
        if (!b2["hasProperty"](k2)) continue;
        const l2 = b2["getProperty"](k2);
        if (l2 == null) continue;
        g2[k2] = l2;
      }
      e2 = { "attr": g2, "feature": b2 };
    } else a$b["defined"](b2["primitive"]) ? c2 = b2["primitive"] : console["log"]("_getPickTarget: 拾取到了对象，请确认是否要做处理", b2);
    return c2 && (d2 = d2 || this["earth"]["getLayerById"](c2["_pie3d_layerId"])), { "pickedObject": b2, "sourceTarget": c2, "layer": d2, "picked3DTileFeature": e2 };
  }
  ["_getPickImageryLayerFeatures"](b2, c2) {
    const d2 = this["viewer"]["scene"], e2 = d2["camera"]["getPickRay"](b2);
    if (!e2) return;
    const f2 = d2["imageryLayers"]["pickImageryLayerFeatures"](e2, d2);
    if (!a$b["defined"](f2)) return;
    Promise["resolve"](f2)["then"]((g2) => {
      this["_clickTileGraphicHandler"](g2, b2, c2);
    })["catch"]((g2) => {
      handlerError("NOT_THROW", "pickImageryLayerFeatures:出错了");
    });
  }
  ["_clickTileGraphicHandler"](b2, c2, d2) {
    if (!a$b["defined"](b2) || b2["length"] == 0) return;
    const e2 = b2[0], f2 = e2["imageryLayer"], g2 = this["earth"]["getLayerById"](f2["_pie3d_layerId"]), h2 = { "sourceTarget": f2, "layer": g2, "pickedFeature": e2, "features": b2, "cartesian": d2 == null ? void 0 : d2["cartesian"], "windowPosition": c2 };
    g2 && g2["emit"](EventType["click"], h2, ![]), this["earth"]["emit"](EventType["clickTileGraphic"], h2);
  }
  ["_allowDrillPick"](b2) {
    var _a;
    const c2 = (_a = b2["layer"]) == null ? void 0 : _a["allowDrillPick"];
    if (c2) return isFunction(c2) ? c2(b2) : !![];
    return ![];
  }
  ["_activateMouseOver"](b2) {
    if (this["_lastMouseOverItem"] && b2["id"] && b2["id"] == this["_lastMouseOverItem"]["id"]) return;
    this["_activateMouseOut"](), this["_fireTargetEvent"](EventType["mouseOver"], b2), this["_lastMouseOverItem"] = b2;
  }
  ["_activateMouseOut"]() {
    if (this["_lastMouseOverItem"] == null) return;
    this["_fireTargetEvent"](EventType["mouseOut"], this["_lastMouseOverItem"]), this["_lastMouseOverItem"] = null;
  }
  ["_fireTargetEvent"](b2, c2) {
    var _a;
    const d2 = c2["sourceTarget"][b2];
    if (d2 && typeof d2 == "function") d2(c2);
    else ((_a = c2["layer"]) == null ? void 0 : _a["emit"]) ? c2["layer"]["emit"](b2, c2, !![]) : this["earth"]["emit"](b2, c2);
  }
  ["destroy"]() {
    var _a;
    (_a = this["handler"]) == null ? void 0 : _a["destroy"](), delete this["handler"], this["viewer"]["canvas"]["removeEventListener"]("keydown", this["_onKeyDown"]), this["viewer"]["canvas"]["removeEventListener"]("keyup", this["_onKeyUp"]);
  }
}
class SceneEvent {
  constructor(a2) {
    __publicField(this, "viewer");
    this["viewer"] = a2;
  }
  ["on"](a2, b2, c2) {
    if (!b2) return;
    let d2;
    switch (a2) {
      case EventType["cameraMoveStart"]:
        d2 = this["viewer"]["camera"]["moveStart"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["cameraMoveEnd"]:
        d2 = this["viewer"]["camera"]["moveEnd"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["cameraChanged"]:
        d2 = this["viewer"]["camera"]["changed"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["preUpdate"]:
        d2 = this["viewer"]["scene"]["preUpdate"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["postUpdate"]:
        d2 = this["viewer"]["scene"]["postUpdate"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["preRender"]:
        d2 = this["viewer"]["scene"]["preRender"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["postRender"]:
        d2 = this["viewer"]["scene"]["postRender"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["renderError"]:
        d2 = this["viewer"]["scene"]["renderError"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["morphStart"]:
        d2 = this["viewer"]["scene"]["morphStart"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["morphComplete"]:
        d2 = this["viewer"]["scene"]["morphComplete"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["clockTick"]:
        d2 = this["viewer"]["clock"]["onTick"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["terrainChange"]:
        d2 = this["viewer"]["scene"]["globe"]["terrainProviderChanged"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["tileLoadProgress"]:
        d2 = this["viewer"]["scene"]["globe"]["tileLoadProgressEvent"]["addEventListener"](b2, c2 || this);
        break;
    }
    return d2;
  }
  ["off"](a2, b2, c2) {
    let d2 = ![];
    switch (a2) {
      case EventType["cameraMoveStart"]:
        d2 = this["viewer"]["camera"]["moveStart"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["cameraMoveEnd"]:
        d2 = this["viewer"]["camera"]["moveEnd"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["cameraChanged"]:
        d2 = this["viewer"]["camera"]["changed"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["preUpdate"]:
        d2 = this["viewer"]["scene"]["preUpdate"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["postUpdate"]:
        d2 = this["viewer"]["scene"]["postUpdate"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["preRender"]:
        d2 = this["viewer"]["scene"]["preRender"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["postRender"]:
        d2 = this["viewer"]["scene"]["postRender"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["renderError"]:
        d2 = this["viewer"]["scene"]["renderError"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["morphStart"]:
        d2 = this["viewer"]["scene"]["morphStart"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["morphComplete"]:
        d2 = this["viewer"]["scene"]["morphComplete"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["clockTick"]:
        d2 = this["viewer"]["clock"]["onTick"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["terrainChange"]:
        d2 = this["viewer"]["scene"]["globe"]["terrainProviderChanged"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["tileLoadProgress"]:
        d2 = this["viewer"]["scene"]["globe"]["tileLoadProgressEvent"]["removeEventListener"](b2, c2 || this);
        break;
    }
    return d2;
  }
}
const zoomControl = [{ "uuid": "cesium-zoomout-button", "title": "缩小", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M19 13H5v-2h14z"/></svg>', "onClick": (a2) => zoomOut(a2) }, { "uuid": "cesium-zoomin-button", "title": "放大", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"/></svg>', "onClick": (a2) => zoomIn(a2) }];
a$b["Ion"]["defaultAccessToken"] = defaultToken["ion"], a$b["Camera"]["DEFAULT_VIEW_RECTANGLE"] = a$b["Rectangle"]["fromDegrees"](...defaultViewRectangle);
const _Earth = class _Earth extends BaseClass {
  constructor(b2, c2, d2) {
    var _a;
    super({ "viewerOptions": c2, "earthOptions": d2 });
    __publicField(this, "viewerOptions");
    __publicField(this, "earthOptions");
    __publicField(this, "viewer");
    __publicField(this, "_layerIdx", 1);
    __publicField(this, "_arrLayerIdx", []);
    __publicField(this, "_layerCache");
    __publicField(this, "_sceneEvent");
    __publicField(this, "_mouseEvent");
    __publicField(this, "_chinaCRS");
    __publicField(this, "smallTooltip");
    this["viewerOptions"] = { ...this["originOptions"]["viewerOptions"] }, this["earthOptions"] = { ...this["originOptions"]["earthOptions"] }, this["setToken"](d2 == null ? void 0 : d2["token"]), this["viewer"] = this["_createViewer"](b2, c2, d2), this["viewer"]["container"]["classList"]["add"]("pie3d-cesium-container"), _Earth["EarthCache"]["set"](this["uuid"], this), this["_chinaCRS"] = ((_a = this["earthOptions"]) == null ? void 0 : _a["chinaCRS"]) ?? ChinaCRS["WGS84"], (d2 == null ? void 0 : d2["zoomButton"]) && addButton(this["viewer"], zoomControl), (d2 == null ? void 0 : d2["homeVision"]) && flyTo(this["viewer"], d2["homeVision"]), this["_layerCache"] = {}, this["_layerIdx"] = 0, this["_sceneEvent"] = new SceneEvent(this["viewer"]), this["_mouseEvent"] = new MouseEvent(this), this["smallTooltip"] = new SmallTooltip(this["viewer"]), this["_initLayers"]();
  }
  static ["getInstance"](b2) {
    return _Earth["EarthCache"]["get"](b2);
  }
  ["_createViewer"](b2, c2, d2) {
    return callWithErrorHandling("THROW", "Earth.constructor", () => {
      let e2;
      if (isString(b2)) {
        const f2 = b2["replace"](/^#/, ""), g2 = document["getElementById"](f2);
        if (g2) b2 = g2;
        else throw new TypeError('Element with id "' + b2 + '" does not exist in the document.');
      }
      if (isElement(b2) || b2 instanceof a$b["Viewer"]) return isElement(b2) ? e2 = new a$b["Viewer"](b2, c2) : e2 = b2, e2;
      else throw new TypeError("the view param is not in 【string | Element | Cesium.Viewer】");
    });
  }
  ["destroy"]() {
    _Earth["EarthCache"]["delete"](this["uuid"]), this["viewer"]["destroy"](), super["destroy"]();
  }
  get ["imageryLayers"]() {
    return this["viewer"]["imageryLayers"];
  }
  get ["imageryLayersArr"]() {
    const b2 = Array["from"]({ "length": this["viewer"]["imageryLayers"]["length"] ?? 0 })["map"]((c2, d2) => {
      return this["viewer"]["imageryLayers"]["get"](d2);
    });
    return b2;
  }
  get ["dataSources"]() {
    return this["viewer"]["dataSources"];
  }
  get ["entities"]() {
    return this["viewer"]["entities"];
  }
  get ["hasTerrain"]() {
    return !(this["viewer"]["terrainProvider"] instanceof a$b["EllipsoidTerrainProvider"]);
  }
  ["setRenderErrorHandler"](b2) {
    setRenderErrorHandler(this["viewer"], b2);
  }
  ["setToken"](b2) {
    a$b["Ion"]["defaultAccessToken"] = (b2 == null ? void 0 : b2["ion"]) ?? defaultToken["ion"];
  }
  ["cancelFlyTo"]() {
    cancelFlyTo(this["viewer"]);
  }
  ["flyHome"](b2) {
    var _a, _b;
    ((_a = this["earthOptions"]) == null ? void 0 : _a["homeVision"]) && flyTo(this["viewer"], { ...(_b = this["earthOptions"]) == null ? void 0 : _b["homeVision"], ...b2 });
  }
  ["flyTo"](b2) {
    flyTo(this["viewer"], b2);
  }
  ["flyToPoint"](b2, c2 = {}) {
    flyToPoint(this["viewer"], b2, c2);
  }
  ["flyToExtent"](b2, c2 = {}) {
    flyToExtent(this["viewer"], b2, c2);
  }
  ["flyToPositions"](b2, c2 = {}) {
    flyToPositions(this["viewer"], b2, c2);
  }
  ["getCameraView"](b2) {
    return getCameraView(this["viewer"], b2);
  }
  ["getExtent"](b2 = LatLngPoint["FormatLength"]) {
    return getExtent(this["viewer"], b2);
  }
  ["_initLayers"]() {
    var _a, _b, _c;
    this["_layerIdx"] = 1, this["_arrLayerIdx"] = [];
    const b2 = (_a = this["earthOptions"]) == null ? void 0 : _a["layers"], c2 = [];
    b2 == null ? void 0 : b2["forEach"]((d2, e2) => {
      d2["id"] !== void 0 ? this["_arrLayerIdx"]["push"](d2["id"]) : d2["id"] = this["_getNextLayerId"]();
      const f2 = createLayer(d2);
      if (!f2) return;
      d2["show"] && this["addLayer"](f2);
      c2["push"](d2);
      if (f2["hasChildLayer"] && d2["layers"]) for (let g2 = 0; g2 < d2["layers"]["length"]; g2++) {
        const h2 = d2["layers"][g2];
        h2["pid"] = d2["id"], h2["parent"] = f2, !h2["id"] && (h2["id"] = this["_getNextLayerId"]()), c2["push"](h2);
      }
    });
    for (let d2 = 0; d2 < c2["length"]; d2++) {
      const e2 = c2[d2];
      let f2 = Number(e2["zIndex"]);
      Number["isNaN"](f2) && (f2 = d2), e2["zIndex"] = f2, this["_layerCache"][e2["id"]] && Reflect["has"](this["_layerCache"][e2["id"]], "setZIndex") && ((_c = (_b = this["_layerCache"][e2["id"]])["setZIndex"]) == null ? void 0 : _c.call(_b, f2));
    }
  }
  ["_getNextLayerId"]() {
    while (this["_arrLayerIdx"]["includes"](this["_layerIdx"])) {
      this["_layerIdx"]++;
    }
    return this["_arrLayerIdx"]["push"](this["_layerIdx"]), this["_layerIdx"];
  }
  ["getLayerById"](b2) {
    if (a$b["defined"](this["_layerCache"][b2])) return this["_layerCache"][b2];
    const c2 = this["getLayers"]();
    for (let d2 = 0, e2 = c2["length"]; d2 < e2; d2++) {
      const f2 = c2[d2];
      if (f2["uuid"] == b2 || f2["id"] == b2) return f2;
      if (f2["hasChildLayer"] && f2["arrLayer"]) for (let g2 = 0; g2 < f2["arrLayer"]["length"]; g2++) {
        const h2 = f2["arrLayer"][g2];
        if (h2["uuid"] == b2 || h2["id"] == b2) return h2;
      }
    }
    return void 0;
  }
  ["getLayerByAttr"](b2, c2 = "id") {
    if (a$b["defined"](this["_layerCache"][b2])) return this["_layerCache"][b2];
    const d2 = this["getLayers"]();
    for (let e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
      const g2 = d2[e2];
      if (g2["options"][c2] == b2) return g2;
    }
    return void 0;
  }
  ["getLayers"]() {
    const b2 = [];
    return Object["keys"](this["_layerCache"])["forEach"]((c2) => {
      const d2 = this["_layerCache"][c2];
      if (d2["options"]["isInternal"]) return;
      b2["push"](d2);
    }), b2;
  }
  ["getTileLayers"]() {
    const b2 = [];
    return Object["keys"](this["_layerCache"])["forEach"]((c2) => {
      const d2 = this["_layerCache"][c2];
      d2["isTile"] && !d2["options"]["isInternal"] && b2["push"](d2);
    }), b2;
  }
  ["eachLayer"](b2, c2) {
    Object["keys"](this["_layerCache"])["forEach"]((d2, e2) => {
      const f2 = this["_layerCache"][d2];
      b2["call"](c2, f2, e2);
    });
  }
  ["addLayer"](b2, c2) {
    a$b["defined"](c2) && (b2["show"] = c2);
    if (b2["state"] === State["ADDED"]) return;
    b2["_onAdd"](this), b2["id"] && this["_layerCache"][b2["id"]] && this["_layerCache"][b2["id"]] !== b2 && (b2["options"]["id"] = this["_getNextLayerId"](), handlerError("NOT_THROW", ["addLayer: 图层id存在冲突，已重新赋值id", b2])), b2["id"] && (this["_layerCache"][b2["id"]] = b2);
  }
  ["removeLayer"](b2, c2 = !![]) {
    if (isString(b2) || isNumber(b2)) {
      b2 = this["_layerCache"][b2];
      if (!b2) return;
    }
    if (b2["state"] !== State["ADDED"]) return;
    b2["id"] && delete this["_layerCache"][b2["id"]], b2["_onRemove"](), c2 && b2["destroy"]();
  }
  ["on"](b2, c2, d2) {
    let e2;
    return typeof b2 == "string" && (e2 = this["_sceneEvent"]["on"](b2, c2, d2 || this)), !e2 && super["on"](b2, c2, d2), this;
  }
  ["off"](b2, c2, d2) {
    const e2 = this["_sceneEvent"]["off"](b2, c2, d2 || this);
    return !e2 && super["off"](b2, c2, d2), this;
  }
};
__publicField(_Earth, "EarthCache", /* @__PURE__ */ new Map());
let Earth = _Earth;
class BaseOptsConver {
  constructor(b2 = {}) {
    __publicField(this, "options");
    this["options"] = b2;
  }
  static ["getColorByStyle"](b2) {
    return new BaseOptsConver()["getColorByStyle"](b2);
  }
  get ["excludedKeys"]() {
    return [];
  }
  get ["exportKeys"]() {
    return ["label", "outlineStyle", "highlight"];
  }
  ["_toCesiumValBefore"](b2, c2) {
  }
  ["_toCesiumValEnd"](b2, c2) {
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      default:
        e2[b2] = c2;
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
  }
  ["toCesiumVal"](b2, c2 = {}) {
    this["_toCesiumValBefore"](b2, c2);
    for (const d2 in b2) {
      const e2 = b2[d2];
      if (!isSimpleType(e2)) {
        c2[d2] = e2;
        continue;
      }
      if (this["excludedKeys"] && this["excludedKeys"]["includes"](d2)) continue;
      const f2 = this["_toOneCesiumVal"](d2, e2, b2, c2);
      if (f2 == null) continue;
      c2[d2] = f2;
    }
    return this["_toCesiumValEnd"](b2, c2), c2;
  }
  ["toJSON"](b2, c2 = {}) {
    b2 = getAttrVal(b2);
    for (const d2 in b2) {
      const e2 = b2[d2];
      if (isSimpleType(e2)) c2[d2] = e2;
      else this["exportKeys"] && this["exportKeys"]["includes"](d2) ? c2[d2] = getAttrVal(e2) : this["_toOneJson"](d2, b2[d2], c2);
    }
    return c2;
  }
  ["getColorByStyle"](b2) {
    return getColorByStyle(b2, this["options"]["color"]);
  }
  ["getOutlineColorByStyle"](b2) {
    let c2;
    b2["outlineColor"] ? isString(b2["outlineColor"]) ? c2 = a$b["Color"]["fromCssColorString"](b2["outlineColor"]) : c2 = b2["outlineColor"] : c2 = this["options"]["outlineColor"];
    if (!c2) return c2;
    if (a$b["defined"](b2["outlineOpacity"])) c2 = c2["withAlpha"](Number(b2["outlineOpacity"]));
    else a$b["defined"](b2["opacity"]) && (c2 = c2["withAlpha"](Number(b2["opacity"])));
    return c2;
  }
}
class BaseMaterialConver extends BaseOptsConver {
  static ["toCesiumVal"](b2, c2 = {}) {
    return !this["baseMaterialConver"] && (this["baseMaterialConver"] = new BaseMaterialConver()), this["baseMaterialConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2 = {}) {
    return new BaseMaterialConver()["toJSON"](b2, c2);
  }
  get ["excludedKeys"]() {
    const b2 = ["label"];
    return b2["concat"](this["_getExcludedStyle"]());
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "color":
      case "randomColor":
        e2["color"] = this["getColorByStyle"](d2);
        break;
      case "color2":
      case "evenColor":
      case "outlineColor":
      case "oddColor":
      case "baseWaterColor":
      case "blendColor":
      case "gapColor":
      case "strokeColor":
      case "backgroundColor":
      case "asphaltColor":
      case "lightColor":
      case "darkColor":
      case "grassColor":
      case "dirtColor":
      case "lightWoodColor":
      case "darkWoodColor":
        e2[b2] = getCesiumColor(c2);
        break;
      case "repeat_x":
      case "repeat_y": {
        const f2 = a$b["defaultValue"](d2["repeat_x"], 1), g2 = a$b["defaultValue"](d2["repeat_y"], 1);
        e2["repeat"] = new a$b["Cartesian2"](f2, g2);
        break;
      }
      case "repeat": {
        d2["materialType"] == MaterialType["Stripe"] || d2["materialType"] == MaterialType["CylinderWave"] ? e2[b2] = c2 : e2[b2] = new a$b["Cartesian2"](d2["repeat_x"] || c2, d2["repeat_y"] || c2);
        break;
      }
      case "lineCount":
      case "lineThickness":
      case "lineOffset":
      case "noiseScale": {
        e2[b2] = new a$b["Cartesian2"](c2, c2);
        break;
      }
      default:
        e2[b2] = c2;
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
    if (c2 instanceof a$b["Color"]) {
      d2[b2] = c2["toCssColorString"]();
      return;
    }
    switch (b2) {
      case "label":
        break;
      case "color":
      case "evenColor":
      case "outlineColor":
      case "oddColor":
      case "baseWaterColor":
      case "blendColor":
      case "gapColor":
      case "strokeColor":
      case "backgroundColor":
      case "asphaltColor":
      case "lightColor":
      case "darkColor":
      case "grassColor":
      case "dirtColor":
      case "lightWoodColor":
      case "darkWoodColor": {
        const e2 = getCesiumValue(c2, a$b["Color"]);
        e2 && (d2[b2] = e2["toCssColorString"]());
        break;
      }
      case "repeat": {
        c2 instanceof a$b["Cartesian2"] ? c2["x"] != c2["y"] ? (d2[b2 + "_x"] = c2["x"], d2[b2 + "_y"] = c2["y"]) : d2[b2] = c2["x"] : d2[b2] = c2;
        break;
      }
      case "lineCount":
      case "lineThickness":
      case "lineOffset":
      case "noiseScale": {
        d2[b2 + "_x"] = c2["x"], d2[b2 + "_y"] = c2["y"];
        break;
      }
      default:
        console["log"]("未处理的属性", b2, c2);
        break;
    }
  }
  ["_getExcludedStyle"]() {
    return [];
  }
  ["toJSON"](b2, c2 = {}) {
    if (b2["options"]) {
      const d2 = b2["options"];
      for (const e2 in d2) {
        a$b["defined"](b2[e2]) && (d2[e2] = b2[e2]);
      }
      b2 = d2;
    }
    return super["toJSON"](b2, c2);
  }
}
class BaseStyleConver extends BaseOptsConver {
  constructor() {
    super(...arguments);
    __publicField(this, "isEntity");
  }
  get ["excludedKeys"]() {
    const c2 = ["label", "outlineOpacity", "outlineStyle", "lineCount", "lineThickness", "cellAlpha", "oddcolor", "speed", "axisY", "image2", "color2", "scaleByDistance_near", "scaleByDistance_nearValue", "scaleByDistance_far", "scaleByDistance_farValue", "distanceDisplayCondition_far", "distanceDisplayCondition_near"];
    return c2["concat"](this["_getExcludedStyle"]());
  }
  ["_toCesiumValBefore"](c2, d2) {
    if (!c2["material"] && !c2["materialType"]) {
      if (c2["color"] || c2["randomColor"]) c2["materialType"] = MaterialType["Color"];
      else c2["image"] && (c2["materialType"] = MaterialType["Image"]);
    }
  }
  ["_getExcludedStyle"]() {
    return [];
  }
  ["_toOneCesiumVal_Point"](c2, d2, e2, f2) {
    switch (c2) {
      case "clampToGround":
        d2 ? f2["heightReference"] = a$b["HeightReference"]["CLAMP_TO_GROUND"] : f2["heightReference"] = a$b["HeightReference"]["NONE"];
        break;
      case "visibleDepth":
        d2 ? f2["disableDepthTestDistance"] = 0 : f2["disableDepthTestDistance"] = Number["POSITIVE_INFINITY"];
        break;
      case "scaleByDistance":
        d2 ? f2["scaleByDistance"] = new a$b["NearFarScalar"](Number(a$b["defaultValue"](e2["scaleByDistance_near"], 1e3)), Number(a$b["defaultValue"](e2["scaleByDistance_nearValue"], 1)), Number(a$b["defaultValue"](e2["scaleByDistance_far"], 1e6)), Number(a$b["defaultValue"](e2["scaleByDistance_farValue"], 0.1))) : f2["scaleByDistance"] = void 0;
        break;
      case "distanceDisplayCondition":
        d2 ? f2["distanceDisplayCondition"] = new a$b["DistanceDisplayCondition"](Number(a$b["defaultValue"](e2["distanceDisplayCondition_near"], 0)), Number(a$b["defaultValue"](e2["distanceDisplayCondition_far"], 1e5))) : f2["distanceDisplayCondition"] = void 0;
        break;
      default:
        f2[c2] = d2;
        break;
    }
  }
  ["_toOneCesiumVal_Poly"](c2, d2, e2, f2) {
    switch (c2) {
      case "materialType": {
        this["isEntity"] ? f2["material"] = createMaterialProperty(e2["materialType"], e2) : f2["material"] = createMaterial(e2["materialType"], e2);
        break;
      }
      case "color":
      case "randomColor": {
        f2["color"] = this["getColorByStyle"](e2);
        break;
      }
      case "outlineColor": {
        f2["outlineColor"] = this["getOutlineColorByStyle"](e2);
        break;
      }
      case "hasShadows":
        d2 ? f2["shadows"] = a$b["ShadowMode"]["ENABLED"] : f2["shadows"] = a$b["ShadowMode"]["DISABLED"];
        break;
      case "distanceDisplayCondition":
        d2 ? this["isEntity"] ? f2["distanceDisplayCondition"] = new a$b["DistanceDisplayCondition"](Number(a$b["defaultValue"](e2["distanceDisplayCondition_near"], 0)), Number(a$b["defaultValue"](e2["distanceDisplayCondition_far"], 1e5))) : f2["distanceDisplayCondition"] = new a$b["DistanceDisplayConditionGeometryInstanceAttribute"](Number(a$b["defaultValue"](e2["distanceDisplayCondition_near"], 0)), Number(a$b["defaultValue"](e2["distanceDisplayCondition_far"], 1e5))) : f2["distanceDisplayCondition"] = void 0;
        break;
      default:
        if (f2[c2] instanceof a$b["CallbackProperty"]) ;
        else f2[c2] = d2;
        break;
    }
  }
  ["_toOneJson_Poly"](c2, d2, e2) {
    switch (c2) {
      case "label":
        break;
      case "material": {
        toJSON(d2, e2);
        break;
      }
      case "color": {
        const f2 = getCesiumValue(d2, a$b["Color"]);
        f2 && (e2[c2] = f2["toCssColorString"]());
        break;
      }
      case "outlineColor": {
        const g2 = getCesiumValue(d2, a$b["Color"]);
        g2 && (e2[c2] = g2["toCssColorString"]());
        break;
      }
      case "shadows": {
        d2 == a$b["ShadowMode"]["ENABLED"] ? e2["shadows"] = !![] : e2[c2] = d2;
        break;
      }
      case "distanceDisplayCondition": {
        e2["distanceDisplayCondition_near"] = d2["near"], e2["distanceDisplayCondition_far"] = d2["far"];
        break;
      }
      default:
        console["log"]("未处理的属性", d2);
        break;
    }
  }
  ["_toOneJson_Point"](c2, d2, e2) {
    switch (c2) {
      case "label":
        break;
      case "color": {
        const f2 = getCesiumValue(d2, a$b["Color"]);
        f2 && (e2["color"] = f2["toCssColorString"]());
        break;
      }
      case "heightReference": {
        d2 == a$b["HeightReference"]["CLAMP_TO_GROUND"] && (e2["clampToGround"] = !![]);
        break;
      }
      case "disableDepthTestDistance": {
        d2 === Number["POSITIVE_INFINITY"] ? e2["visibleDepth"] = ![] : e2["disableDepthTestDistance"] = d2;
        break;
      }
      case "scaleByDistance": {
        e2["scaleByDistance"] = !![], e2["scaleByDistance_near"] = d2["near"], e2["scaleByDistance_nearValue"] = d2["nearValue"], e2["scaleByDistance_far"] = d2["far"], e2["scaleByDistance_farValue"] = d2["farValue"];
        break;
      }
      case "distanceDisplayCondition": {
        e2["distanceDisplayCondition"] = !![], e2["distanceDisplayCondition_near"] = d2["near"], e2["distanceDisplayCondition_far"] = d2["far"];
        break;
      }
      default:
        console["log"]("未处理的属性", d2);
        break;
    }
  }
}
class ColorOptsConver extends BaseMaterialConver {
  static ["toCesiumVal"](b2, c2 = {}, d2) {
    if (b2 instanceof a$b["Color"]) return b2;
    return !this["colorOptsConver"] && (this["colorOptsConver"] = new ColorOptsConver()), this["colorOptsConver"]["isProperty"] = d2, this["colorOptsConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2, d2) {
    return !this["colorOptsConver"] && (this["colorOptsConver"] = new ColorOptsConver()), this["colorOptsConver"]["isProperty"] = d2, this["colorOptsConver"]["toJSON"](b2, c2);
  }
  ["toCesiumVal"](b2) {
    return this["isProperty"] ? this["getColorByStyle"](b2) : { "color": this["getColorByStyle"](b2) };
  }
  ["toJSON"](b2, c2 = {}) {
    let d2 = getCesiumValue(b2, a$b["Color"]);
    return d2["color"] && (d2 = d2["color"]), c2["color"] = d2["toCssColorString"](), c2;
  }
}
class ImageOptsConver extends BaseMaterialConver {
  get ["excludedKeys"]() {
    return ["repeat_y"];
  }
  static ["toCesiumVal"](b2, c2 = {}) {
    return !this["imageOptsConver"] && (this["imageOptsConver"] = new ImageOptsConver()), this["imageOptsConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2) {
    return !this["imageOptsConver"] && (this["imageOptsConver"] = new ImageOptsConver()), this["imageOptsConver"]["toJSON"](b2, c2);
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "repeat_x": {
        const f2 = a$b["defaultValue"](d2["repeat_x"], 1), g2 = a$b["defaultValue"](d2["repeat_y"], 1);
        e2["repeat"] = new a$b["Cartesian2"](f2, g2);
        break;
      }
      case "repeat": {
        e2[b2] = new a$b["Cartesian2"](d2["repeat_x"] || c2, d2["repeat_y"] || c2);
        break;
      }
      case "color":
        break;
      case "opacity":
        e2["color"] = a$b["Color"]["WHITE"]["withAlpha"](d2["opacity"]);
        break;
      default:
        e2[b2] = c2;
        break;
    }
  }
  ["_toCesiumValEnd"](b2, c2) {
    c2["transparent"] = a$b["defaultValue"](c2["transparent"], !![]);
  }
  ["_toOneJson"](b2, c2, d2) {
    var _a;
    switch (b2) {
      case "repeat": {
        d2["repeat_x"] = c2["x"], d2["repeat_y"] = c2["y"];
        break;
      }
      case "color": {
        d2["opacity"] = ((_a = getCesiumValue(c2, a$b["Color"])) == null ? void 0 : _a["alpha"]) ?? 1;
        break;
      }
      default:
        console["log"]("未处理的属性", b2, c2);
        break;
    }
  }
}
class LabelStyleConver extends BaseStyleConver {
  static ["toCesiumVal"](b2, c2 = {}, d2) {
    return !this["labelStyleConver"] && (this["labelStyleConver"] = new LabelStyleConver()), this["labelStyleConver"]["attr"] = d2, c2 = this["labelStyleConver"]["toCesiumVal"](b2, c2), c2;
  }
  static ["toJSON"](b2, c2) {
    return new LabelStyleConver()["toJSON"](b2, c2);
  }
  ["_toCesiumValBefore"](b2, c2) {
    c2["horizontalOrigin"] = a$b["defaultValue"](c2["horizontalOrigin"], a$b["HorizontalOrigin"]["CENTER"]), c2["verticalOrigin"] = a$b["defaultValue"](c2["verticalOrigin"], a$b["VerticalOrigin"]["BOTTOM"]);
  }
  ["_toCesiumValEnd"](b2, c2) {
    if (!a$b["defined"](b2["font"])) {
      const d2 = b2["font_size"] || 18;
      c2["font"] = (b2["font_style"] || "normal") + " small-caps " + (b2["font_weight"] || "normal") + " " + d2 + "px " + (b2["font_family"] || "楷体");
    }
    !a$b["defined"](b2["style"]) && a$b["defaultValue"](b2["fill"], !![]) && (b2["outline"] ? c2["style"] = a$b["LabelStyle"]["FILL_AND_OUTLINE"] : c2["style"] = a$b["LabelStyle"]["FILL"]);
  }
  ["_getExcludedStyle"]() {
    return ["font_style", "font_weight", "font_size", "font_family", "backgroundOpacity", "fill", "outline"];
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "text": {
        this["attr"] && (c2 = template(c2, this["attr"], !![]));
        e2["text"] = c2["replace"](new RegExp("<br />", "g"), "\n");
        break;
      }
      case "color": {
        e2["fillColor"] = this["getColorByStyle"](d2);
        break;
      }
      case "outlineColor": {
        e2["outlineColor"] = this["getOutlineColorByStyle"](d2);
        break;
      }
      case "strokeColor":
      case "fillColor": {
        e2[b2] = getCesiumColor(c2);
        break;
      }
      case "background":
        e2["showBackground"] = c2;
        break;
      case "backgroundColor": {
        let f2 = a$b["Color"]["fromCssColorString"](c2 || "#000000");
        if (a$b["defined"](d2["backgroundOpacity"])) f2 = f2["withAlpha"](Number(d2["backgroundOpacity"]));
        else a$b["defined"](d2["opacity"]) && (f2 = f2["withAlpha"](Number(d2["opacity"])));
        e2["backgroundColor"] = f2;
        break;
      }
      case "backgroundPadding":
        e2["backgroundPadding"] = new a$b["Cartesian2"](c2 * 1.2, c2);
        break;
      case "hasPixelOffset":
        !c2 && (e2["pixelOffset"] = new a$b["Cartesian2"](0, 0));
        break;
      case "pixelOffsetX":
      case "pixelOffsetY":
        e2["pixelOffset"] = new a$b["Cartesian2"](d2["pixelOffsetX"] || 0, d2["pixelOffsetY"] || 0);
        break;
      case "pixelOffset":
        a$b["defined"](c2[0]) && a$b["defined"](c2[1]) ? e2["pixelOffset"] = new a$b["Cartesian2"](c2[0], c2[1]) : e2["pixelOffset"] = c2;
        break;
      default:
        this["_toOneCesiumVal_Point"](b2, c2, d2, e2);
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
    switch (b2) {
      case "pixelOffset": {
        d2["pixelOffsetX"] = c2["x"], d2["pixelOffsetY"] = c2["y"];
        break;
      }
      case "disableDepthTestDistance": {
        c2 === Number["POSITIVE_INFINITY"] ? d2["visibleDepth"] = ![] : d2["disableDepthTestDistance"] = c2;
        break;
      }
      default:
        this["_toOneJson_Point"](b2, c2, d2);
        break;
    }
  }
}
class PolylineStyleConver extends BaseStyleConver {
  static ["toCesiumVal"](b2, c2, d2) {
    return !this["polylineStyleConver"] && (this["polylineStyleConver"] = new PolylineStyleConver()), this["polylineStyleConver"]["isEntity"] = d2, this["polylineStyleConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2, d2) {
    return !this["polylineStyleConver"] && (this["polylineStyleConver"] = new PolylineStyleConver()), this["polylineStyleConver"]["isEntity"] = d2, this["polylineStyleConver"]["toJSON"](b2, c2);
  }
  ["_toCesiumValBefore"](b2, c2) {
    super["_toCesiumValBefore"](b2, c2), b2["clampToGround"] && (c2["arcType"] = a$b["ArcType"]["GEODESIC"]), b2["materialType"] == MaterialType["Color"] && b2["outline"] && b2["outlineColor"] && (b2["materialType"] = MaterialType["PolylineOutline"]);
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "depthFail":
        c2 ? (e2["depthFailMaterial"] = a$b["Color"]["fromCssColorString"](d2["depthFailColor"] || "#FFFF00")["withAlpha"](Number(a$b["defaultValue"](d2["depthFailOpacity"], a$b["defaultValue"](d2["opacity"], 0.9)))), d2["opacity"] == 1 && (d2["opacity"] = 0.9)) : e2["depthFailMaterial"] = void 0;
        break;
      case "closure":
        !this["isEntity"] && (e2["loop"] = c2);
        break;
      default:
        this["_toOneCesiumVal_Poly"](b2, c2, d2, e2);
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
    switch (b2) {
      case "loop":
        d2["closure"] = c2;
        break;
      default:
        this["_toOneJson_Poly"](b2, c2, d2);
        break;
    }
  }
}
const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseMaterialConver,
  BaseOptsConver,
  BaseStyleConver,
  ColorOptsConver,
  ImageOptsConver,
  LabelStyleConver,
  PolylineStyleConver
}, Symbol.toStringTag, { value: "Module" }));
class FlickerEntity {
  constructor() {
    __publicField(this, "entitys");
    __publicField(this, "color");
    __publicField(this, "maxAlpha");
    __publicField(this, "time");
    __publicField(this, "onEnd");
    __publicField(this, "interval");
    __publicField(this, "timeEndVal");
    this["color"] = a$b["Color"]["YELLOW"]["withAlpha"](0);
  }
  ["_updateClr"]() {
    const b2 = this;
    this["entitys"] && loopArrayCallback(this["entitys"], (c2) => {
      c2["point"] && (c2["point"]["color"] = b2["color"]), c2["billboard"] && (c2["billboard"]["color"] = b2["color"]), c2["model"] && (c2["model"]["color"] = b2["color"]), c2["label"] && (c2["label"]["fillColor"] = b2["color"]);
    });
  }
  ["_startTime"]() {
    const b2 = this["maxAlpha"] ?? 0.3, c2 = 30, d2 = b2 / c2;
    let e2 = 0;
    this["interval"] = setInterval(() => {
      var _a;
      e2 += d2, e2 > b2 && (e2 = 0), this["color"] = (_a = this["color"]) == null ? void 0 : _a["withAlpha"](e2), this["_updateClr"]();
    }, c2), this["time"] && (this["timeEndVal"] = setTimeout(() => {
      this["stopFlicker"]();
    }, this["time"] * 1e3));
  }
  ["_stopTime"]() {
    this["interval"] && (clearInterval(this["interval"]), this["interval"] = void 0), this["timeEndVal"] && (clearTimeout(this["timeEndVal"]), this["timeEndVal"] = void 0);
  }
  ["startFlicker"](b2, c2 = {}) {
    const d2 = this;
    return this["stopFlicker"](), this["entitys"] = b2, this["maxAlpha"] = a$b["defaultValue"](c2["maxAlpha"], 0.3), this["time"] = c2["time"], this["color"] = getCesiumColor(c2["color"], a$b["Color"]["YELLOW"]), this["color"] = this["color"]["withAlpha"](this["maxAlpha"]), this["onEnd"] = c2["onEnd"], this["_startTime"](), loopArrayCallback(b2, (e2) => {
      return e2["polygon"] && (e2["polygon"]["material_bak"] = e2["polygon"]["material"], e2["polygon"]["material"] = new a$b["ColorMaterialProperty"](new a$b["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["polyline"] && (e2["polyline"]["material_bak"] = e2["polyline"]["material"], e2["polyline"]["material"] = new a$b["ColorMaterialProperty"](new a$b["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["ellipse"] && (e2["ellipse"]["material_bak"] = e2["ellipse"]["material"], e2["ellipse"]["material"] = new a$b["ColorMaterialProperty"](new a$b["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["rectangle"] && (e2["rectangle"]["material_bak"] = e2["rectangle"]["material"], e2["rectangle"]["material"] = new a$b["ColorMaterialProperty"](new a$b["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["wall"] && (e2["wall"]["material_bak"] = e2["wall"]["material"], e2["wall"]["material"] = new a$b["ColorMaterialProperty"](new a$b["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["point"] && (e2["point"]["color_bak"] = e2["point"]["color"], e2["point"]["color"] = d2["color"]), e2["billboard"] && (e2["billboard"]["color_bak"] = e2["billboard"]["color"], e2["billboard"]["color"] = d2["color"]), e2["model"] && (e2["model"]["color_bak"] = e2["model"]["color"], e2["model"]["color"] = d2["color"]), e2["label"] && (e2["label"]["fillColor_bak"] = e2["label"]["fillColor"], e2["label"]["fillColor"] = d2["color"]), e2;
    }), this;
  }
  ["stopFlicker"]() {
    this["_stopTime"](), this["entitys"] && (loopArrayCallback(this["entitys"], (b2) => {
      b2["polygon"] && (b2["polygon"]["material_bak"] && (b2["polygon"]["material"] = b2["polygon"]["material_bak"])), b2["polyline"] && (b2["polyline"]["material_bak"] && (b2["polyline"]["material"] = b2["polyline"]["material_bak"])), b2["ellipse"] && (b2["ellipse"]["material_bak"] && (b2["ellipse"]["material"] = b2["ellipse"]["material_bak"])), b2["rectangle"] && (b2["rectangle"]["material_bak"] && (b2["rectangle"]["material"] = b2["rectangle"]["material_bak"])), b2["wall"] && (b2["wall"]["material_bak"] && (b2["wall"]["material"] = b2["wall"]["material_bak"])), b2["point"] && (b2["point"]["color_bak"] && (b2["point"]["color"] = b2["point"]["color_bak"])), b2["billboard"] && (b2["billboard"]["color_bak"] ? b2["billboard"]["color"] = b2["billboard"]["color_bak"] : b2["billboard"]["color"] = void 0), b2["model"] && (b2["model"]["color_bak"] ? b2["model"]["color"] = b2["model"]["color_bak"] : b2["model"]["color"] = void 0), b2["label"] && (b2["label"]["fillColor_bak"] && (b2["label"]["fillColor"] = b2["label"]["fillColor_bak"]));
    }), this["onEnd"] && this["onEnd"](this["entitys"]), this["entitys"] = void 0);
  }
}
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  FlickerEntity,
  HighlightTileset
}, Symbol.toStringTag, { value: "Module" }));
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseLayer,
  BaseTileLayer,
  GroupLayer,
  ImageLayer,
  TerrainLayer,
  TilesetLayer,
  WmsLayer,
  WmtsLayer,
  XyzLayer
}, Symbol.toStringTag, { value: "Module" }));
var cellular_default = `vec3 _czm_permute289(vec3 x)\r
{\r
    return mod((34.0 * x + 1.0) * x, 289.0);\r
}

/**\r
 * DOC_TBA\r
 *\r
 * Implemented by Stefan Gustavson, and distributed under the MIT License.  {@link http:
 *\r
 * @name czm_cellular\r
 * @glslFunction\r
 *\r
 * @see Stefan Gustavson's chapter, <i>Procedural Textures in GLSL</i>, in <a href="http:
 */\r
vec2 czm_cellular(vec2 P)

{\r
#define K 0.142857142857 
#define Ko 0.428571428571 
#define jitter 1.0 
    vec2 Pi = mod(floor(P), 289.0);\r
    vec2 Pf = fract(P);\r
    vec3 oi = vec3(-1.0, 0.0, 1.0);\r
    vec3 of = vec3(-0.5, 0.5, 1.5);\r
    vec3 px = _czm_permute289(Pi.x + oi);\r
    vec3 p = _czm_permute289(px.x + Pi.y + oi); 
    vec3 ox = fract(p*K) - Ko;\r
    vec3 oy = mod(floor(p*K),7.0)*K - Ko;\r
    vec3 dx = Pf.x + 0.5 + jitter*ox;\r
    vec3 dy = Pf.y - of + jitter*oy;\r
    vec3 d1 = dx * dx + dy * dy; 
    p = _czm_permute289(px.y + Pi.y + oi); 
    ox = fract(p*K) - Ko;\r
    oy = mod(floor(p*K),7.0)*K - Ko;\r
    dx = Pf.x - 0.5 + jitter*ox;\r
    dy = Pf.y - of + jitter*oy;\r
    vec3 d2 = dx * dx + dy * dy; 
    p = _czm_permute289(px.z + Pi.y + oi); 
    ox = fract(p*K) - Ko;\r
    oy = mod(floor(p*K),7.0)*K - Ko;\r
    dx = Pf.x - 1.5 + jitter*ox;\r
    dy = Pf.y - of + jitter*oy;\r
    vec3 d3 = dx * dx + dy * dy; 
    
    vec3 d1a = min(d1, d2);\r
    d2 = max(d1, d2); 
    d2 = min(d2, d3); 
    d1 = min(d1a, d2); 
    d2 = max(d1a, d2); 
    d1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; 
    d1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; 
    d1.yz = min(d1.yz, d2.yz); 
    d1.y = min(d1.y, d1.z); 
    d1.y = min(d1.y, d2.x); 
    return sqrt(d1.xy);\r
}`;
var snoise_default = `vec4 _czm_mod289(vec4 x)\r
{\r
  return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

vec3 _czm_mod289(vec3 x)\r
{\r
    return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

vec2 _czm_mod289(vec2 x)\r
{\r
    return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

float _czm_mod289(float x)\r
{\r
    return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

vec4 _czm_permute(vec4 x)\r
{\r
    return _czm_mod289(((x*34.0)+1.0)*x);\r
}

vec3 _czm_permute(vec3 x)\r
{\r
    return _czm_mod289(((x*34.0)+1.0)*x);\r
}

float _czm_permute(float x)\r
{\r
    return _czm_mod289(((x*34.0)+1.0)*x);\r
}

vec4 _czm_taylorInvSqrt(vec4 r)\r
{\r
    return 1.79284291400159 - 0.85373472095314 * r;\r
}

float _czm_taylorInvSqrt(float r)\r
{\r
    return 1.79284291400159 - 0.85373472095314 * r;\r
}

vec4 _czm_grad4(float j, vec4 ip)\r
{\r
    const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\r
    vec4 p,s;

    p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\r
    p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\r
    s = vec4(lessThan(p, vec4(0.0)));\r
    p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;

    return p;\r
}

/**\r
 * DOC_TBA\r
 *\r
 * Implemented by Ian McEwan, Ashima Arts, and distributed under the MIT License.  {@link https:
 *\r
 * @name czm_snoise\r
 * @glslFunction\r
 *\r
 * @see <a href="https:
 * @see Stefan Gustavson's paper <a href="http:
 */\r
float czm_snoise(vec2 v)\r
{\r
    const vec4 C = vec4(0.211324865405187,  
                        0.366025403784439,  
                       -0.577350269189626,  
                        0.024390243902439); 
    
    vec2 i  = floor(v + dot(v, C.yy) );\r
    vec2 x0 = v -   i + dot(i, C.xx);

    
    vec2 i1;\r
    
    
    i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\r
    
    
    
    vec4 x12 = x0.xyxy + C.xxzz;\r
    x12.xy -= i1;

    
    i = _czm_mod289(i); 
    vec3 p = _czm_permute( _czm_permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 ));

    vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\r
    m = m*m ;\r
    m = m*m ;

    
    
    vec3 x = 2.0 * fract(p * C.www) - 1.0;\r
    vec3 h = abs(x) - 0.5;\r
    vec3 ox = floor(x + 0.5);\r
    vec3 a0 = x - ox;

    
    
    m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );

    
    vec3 g;\r
    g.x  = a0.x  * x0.x  + h.x  * x0.y;\r
    g.yz = a0.yz * x12.xz + h.yz * x12.yw;\r
    return 130.0 * dot(m, g);\r
}

float czm_snoise(vec3 v)\r
{\r
    const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;\r
    const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);

    
    vec3 i  = floor(v + dot(v, C.yyy) );\r
    vec3 x0 =   v - i + dot(i, C.xxx) ;

    
    vec3 g = step(x0.yzx, x0.xyz);\r
    vec3 l = 1.0 - g;\r
    vec3 i1 = min( g.xyz, l.zxy );\r
    vec3 i2 = max( g.xyz, l.zxy );

    
    
    
    
    vec3 x1 = x0 - i1 + C.xxx;\r
    vec3 x2 = x0 - i2 + C.yyy; 
    vec3 x3 = x0 - D.yyy;      

    
    i = _czm_mod289(i);\r
    vec4 p = _czm_permute( _czm_permute( _czm_permute(\r
                i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\r
              + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\r
              + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));

    
    
    float n_ = 0.142857142857; 
    vec3  ns = n_ * D.wyz - D.xzx;

    vec4 j = p - 49.0 * floor(p * ns.z * ns.z);  

    vec4 x_ = floor(j * ns.z);\r
    vec4 y_ = floor(j - 7.0 * x_ );    

    vec4 x = x_ *ns.x + ns.yyyy;\r
    vec4 y = y_ *ns.x + ns.yyyy;\r
    vec4 h = 1.0 - abs(x) - abs(y);

    vec4 b0 = vec4( x.xy, y.xy );\r
    vec4 b1 = vec4( x.zw, y.zw );

    
    
    vec4 s0 = floor(b0)*2.0 + 1.0;\r
    vec4 s1 = floor(b1)*2.0 + 1.0;\r
    vec4 sh = -step(h, vec4(0.0));

    vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\r
    vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;

    vec3 p0 = vec3(a0.xy,h.x);\r
    vec3 p1 = vec3(a0.zw,h.y);\r
    vec3 p2 = vec3(a1.xy,h.z);\r
    vec3 p3 = vec3(a1.zw,h.w);

    
    vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\r
    p0 *= norm.x;\r
    p1 *= norm.y;\r
    p2 *= norm.z;\r
    p3 *= norm.w;

    
    vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\r
    m = m * m;\r
    return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\r
                                dot(p2,x2), dot(p3,x3) ) );\r
}

float czm_snoise(vec4 v)\r
{\r
    const vec4  C = vec4( 0.138196601125011,  
                          0.276393202250021,  
                          0.414589803375032,  
                         -0.447213595499958); 

    
    #define F4 0.309016994374947451

    
    vec4 i  = floor(v + dot(v, vec4(F4)) );\r
    vec4 x0 = v -   i + dot(i, C.xxxx);

    

    
    vec4 i0;\r
    vec3 isX = step( x0.yzw, x0.xxx );\r
    vec3 isYZ = step( x0.zww, x0.yyz );\r
    
    i0.x = isX.x + isX.y + isX.z;\r
    i0.yzw = 1.0 - isX;\r
    
    i0.y += isYZ.x + isYZ.y;\r
    i0.zw += 1.0 - isYZ.xy;\r
    i0.z += isYZ.z;\r
    i0.w += 1.0 - isYZ.z;

    
    vec4 i3 = clamp( i0, 0.0, 1.0 );\r
    vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\r
    vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );

    
    
    
    
    
    vec4 x1 = x0 - i1 + C.xxxx;\r
    vec4 x2 = x0 - i2 + C.yyyy;\r
    vec4 x3 = x0 - i3 + C.zzzz;\r
    vec4 x4 = x0 + C.wwww;

    
    i = _czm_mod289(i);\r
    float j0 = _czm_permute( _czm_permute( _czm_permute( _czm_permute(i.w) + i.z) + i.y) + i.x);\r
    vec4 j1 = _czm_permute( _czm_permute( _czm_permute( _czm_permute (\r
               i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\r
             + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\r
             + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\r
             + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));

    
    
    vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;

    vec4 p0 = _czm_grad4(j0,   ip);\r
    vec4 p1 = _czm_grad4(j1.x, ip);\r
    vec4 p2 = _czm_grad4(j1.y, ip);\r
    vec4 p3 = _czm_grad4(j1.z, ip);\r
    vec4 p4 = _czm_grad4(j1.w, ip);

    
    vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\r
    p0 *= norm.x;\r
    p1 *= norm.y;\r
    p2 *= norm.z;\r
    p3 *= norm.w;\r
    p4 *= _czm_taylorInvSqrt(dot(p4,p4));

    
    vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\r
    vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4)            ), 0.0);\r
    m0 = m0 * m0;\r
    m1 = m1 * m1;\r
    return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\r
                  + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\r
}`;
registerProperty(MaterialType["Color"], a$b["ColorMaterialProperty"]), registerProperty(MaterialType["Image"], a$b["ImageMaterialProperty"]), registerProperty(MaterialType["PolylineArrow"], a$b["PolylineArrowMaterialProperty"]), registerProperty(MaterialType["PolylineOutline"], a$b["PolylineOutlineMaterialProperty"]), registerProperty(MaterialType["PolylineDash"], a$b["PolylineDashMaterialProperty"]), registerProperty(MaterialType["PolylineGlow"], a$b["PolylineGlowMaterialProperty"]), registerProperty(MaterialType["Grid"], a$b["GridMaterialProperty"]), registerProperty(MaterialType["Checkerboard"], a$b["CheckerboardMaterialProperty"]), registerProperty(MaterialType["Stripe"], a$b["StripeMaterialProperty"]);
var ColorPatternGradientMaterial_default = "uniform float u_minValue;\r\nuniform float u_maxValue;\r\nuniform vec2 u_resultSize;\r\nfloat val;\r\nfloat calcTexture(sampler2D tex, const vec2 uv) {\r\n    return texture(tex, uv).r;\r\n  }\n\n  float bilinear(sampler2D tex, const vec2 uv) {\r\n    vec2 px = 1.0 / u_resultSize;\r\n    vec2 vc = (floor(uv * u_resultSize)) * px;\r\n    vec2 f = fract(uv * u_resultSize);\r\n    float tl = calcTexture(tex, vc);\r\n    float tr = calcTexture(tex, vc + vec2(px.x, 0));\r\n    float bl = calcTexture(tex, vc + vec2(0, px.y));\r\n    float br = calcTexture(tex, vc + px);\r\n    return mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y);\r\n  }\n\n  float getValue(sampler2D tex, const vec2 uv) {\r\n    float r = bilinear(tex, uv);\r\n    return r * (u_maxValue - u_minValue) + u_minValue;\r\n  }\r\nczm_material czm_getMaterial(czm_materialInput materialInput) {\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec4 color1 = texture(u_image, st);\n\n  float value = getValue(u_image, materialInput.st);\r\n  val = value;\r\n  float value_t = (value - u_minValue) / (u_maxValue - u_minValue);\n\n  vec4 color = texture(u_colorImage, vec2(value_t, 0.5));\n\n  color = czm_gammaCorrect(color);\r\n  float mixVal = 0.0;\r\n  float maxVal = 255.0;\r\n  if(color1.r < (mixVal / 255.0)) {\r\n    color.a = 0.0;\r\n  }\r\n  if(color1.r > (maxVal / 255.0)) {\r\n    color.a = 0.0;\r\n  }\n\n  material.diffuse = color.rgb;\r\n  material.alpha = min(u_alpha, color.a);\r\n  return material;\r\n}";
a$b["Material"]["ColorPatternGradientType"] = MaterialType["ColorPatternGradient"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["ColorPatternGradientType"], { "fabric": { "type": a$b["Material"]["ColorPatternGradientType"], "uniforms": { "u_image": a$b["Material"]["DefaultImageId"], "u_colorImage": a$b["Material"]["DefaultImageId"], "u_alpha": 0.8, "u_minValue": 0, "u_maxValue": 50, "u_resultSize": new a$b["Cartesian2"](2880, 1440) }, "source": ColorPatternGradientMaterial_default }, "translucent": !![] });
var CylinderWaveMaterial_default = "uniform vec4 color;\r\nuniform float repeat;\r\nuniform float offset;\r\nuniform float thickness;\r\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    float sp = 1.0/repeat;\r\n    vec2 st = materialInput.st;\r\n    float dis = distance(st, vec2(0.5));\r\n    float m = mod(dis + offset, sp);\r\n    float a = step(sp*(1.0-thickness), m);\r\n    material.diffuse = color.rgb;\r\n    material.alpha = a * color.a;\r\n    return material;\r\n}";
class CylinderWaveMaterial extends a$b["Material"] {
  constructor(c2 = {}) {
    super(conventOptions$1(c2));
    __publicField(this, "frameTime");
    __publicField(this, "animateFrame");
    this["frameTime"] = 1e3 / (c2["frameRate"] || 60);
    const d2 = this;
    let e2 = Date["now"]();
    (function f2() {
      d2["animateFrame"] = window["requestAnimationFrame"](f2);
      const g2 = Date["now"](), h2 = g2 - e2;
      h2 > d2["frameTime"] && (e2 = g2 - h2 % d2["frameTime"], d2["_updateOffset"]());
    })();
  }
  ["_updateOffset"]() {
    let c2 = this["uniforms"]["offset"];
    c2 -= 1e-3, c2 > 1 && (c2 = 0), this["uniforms"]["offset"] = c2;
  }
  ["destroy"]() {
    a$b["defined"](this["animateFrame"]) && (window["cancelAnimationFrame"](this["animateFrame"]), delete this["animateFrame"]), super["destroy"]();
  }
}
function conventOptions$1(c2 = {}) {
  return { "fabric": { "uniforms": { "color": getCesiumColor(c2["color"], new a$b["Color"](2, 1, 0, 0.8)), "repeat": a$b["defaultValue"](c2["repeat"], 30), "thickness": a$b["defaultValue"](c2["thickness"], 0.3), "offset": 0 }, "source": CylinderWaveMaterial_default }, "translucent"(d2) {
    return d2["uniforms"]["color"]["alpha"] < 1;
  } };
}
registerMaterial(MaterialType["CylinderWave"], CylinderWaveMaterial);
var ImageMaterial_default = "uniform sampler2D image;\r\nuniform float opacity;\r\nuniform vec4 color;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec4 colorImage = texture2D(image,st);\r\n  if(colorImage.rgb == vec3(1.0)){\r\n    discard;\r\n  }\r\n  material.alpha = colorImage.a * opacity * color.a;\r\n  material.diffuse = colorImage.rgb * color.rgb;\r\n  return material;\r\n}";
class TextMaterial extends a$b["Material"] {
  constructor(c2 = {}) {
    super(conventOptions(c2));
  }
}
function conventOptions(c2 = {}) {
  const d2 = c2["text"];
  c2["font_size"] = c2["font_size"] || 70;
  const e2 = LabelStyleConver["toCesiumVal"](c2, { "fill": !![], "fillColor": new a$b["Color"](1, 1, 0, 1), "textBaseline": "middle", "padding": 10 });
  let f2;
  if (d2) {
    const g2 = getTextImage(d2, e2);
    g2 && (f2 = g2["toDataURL"]("image/png"));
  }
  return { "fabric": { "uniforms": { "image": f2, "opacity": 1, "color": a$b["Color"]["WHITE"] }, "source": ImageMaterial_default }, "translucent": !![] };
}
registerMaterial(MaterialType["Text"], TextMaterial);
class BaseMaterialProperty {
  constructor(b2 = {}) {
    __publicField(this, "_definitionChanged");
    __publicField(this, "_color");
    __publicField(this, "_colorSubscription");
    __publicField(this, "_speed");
    __publicField(this, "_speedSubscription");
    __publicField(this, "options");
    this["options"] = b2, this["_definitionChanged"] = new a$b["Event"](), this["_color"] = void 0, this["_colorSubscription"] = void 0, this["_speed"] = void 0, this["_speedSubscription"] = void 0;
  }
  get ["isConstant"]() {
    return !![];
  }
  get ["definitionChanged"]() {
    return this["_definitionChanged"];
  }
}
var CircleScanMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = materialInput.st;\r\n    vec4 imgC = texture2D(image,st);\r\n    if(imgC.a>.0){\r\n        material.diffuse = color.rgb;\r\n    }\r\n    material.alpha = imgC.a * color.a;\r\n    return material;\r\n}";
class CircleScanMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](1, 0, 0, 0.5));
  }
  ["getType"](c2) {
    return MaterialType["CircleScan"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["image"] = this["_image"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof CircleScanMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_image"] == c2["_image"];
  }
}
registerProperty(MaterialType["CircleScan"], CircleScanMaterialProperty), a$b["Material"]["CircleScanType"] = MaterialType["CircleScan"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["CircleScanType"], { "fabric": { "type": a$b["Material"]["CircleScanType"], "uniforms": { "color": new a$b["Color"](1, 0, 0, 1), "image": a$b["Material"]["DefaultImageId"] }, "source": CircleScanMaterial_default }, "translucent": !![] });
var CircleWaveMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    material.diffuse = 1.5 * color.rgb;\r\n    vec2 st = materialInput.st;\n\n    float dis = distance(st, vec2(0.5, 0.5));\r\n    float per = fract(speed*czm_frameNumber/1000.0);\r\n    if(count==1.0){\r\n        if(dis > per * 0.5){ \r\n            discard;\r\n        }else {\r\n            material.alpha = color.a  * dis / per / 2.0;\r\n        }\r\n    }\r\n    else{\r\n        vec3 str = materialInput.str;\r\n        if(abs(str.z)>0.001){\r\n            discard;\r\n        }\r\n        if(dis >0.5){\r\n            discard;\r\n        }\r\n        else {\r\n            float perDis = 0.5/count;\r\n            float disNum;\r\n            float bl = 0.0;\r\n            for(int i=0;i<=999;i++){\r\n                if(float(i)<=count){\r\n                    disNum = perDis*float(i) - dis + per/count;\r\n                    if(disNum>0.0){\r\n                        if(disNum<perDis){\r\n                            bl = 1.0-disNum/perDis;\r\n                        }\r\n                        else if(disNum-perDis<perDis){\r\n                            bl = 1.0 - abs(1.0-disNum/perDis);\r\n                        }\r\n                        material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    } \r\n    return material;\r\n}";
class CircleWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_count");
    __publicField(this, "_gradient");
    this["_color"] = getCesiumColor(c2["color"], a$b["Color"]["YELLOW"]), this["_speed"] = a$b["defaultValue"](c2["speed"], 10), this["_count"] = a$b["defaultValue"](c2["count"], 1), this["_gradient"] = a$b["defaultValue"](c2["gradient"], 0.1), this["_count"] <= 0 && (this["_count"] = 1), this["_gradient"] < 0 && (this["_gradient"] = 0), this["_gradient"] > 1 && (this["_gradient"] = 1);
  }
  ["getType"](c2) {
    return MaterialType["CircleWave"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["count"] = this["_count"], d2["gradient"] = this["_gradient"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof CircleWaveMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_count"] == c2["_count"] && this["_speed"] == c2["_speed"] && this["_gradient"] == c2["_gradient"];
  }
}
registerProperty(MaterialType["CircleWave"], CircleWaveMaterialProperty), a$b["Material"]["CircleWaveType"] = MaterialType["CircleWave"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["CircleWaveType"], { "fabric": { "type": a$b["Material"]["CircleWaveType"], "uniforms": { "color": new a$b["Color"](1, 1, 0, 1), "speed": 10, "count": 1, "gradient": 0.1 }, "source": CircleWaveMaterial_default }, "translucent": !![] });
class CylinderWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_repeat");
    __publicField(this, "_thickness");
    __publicField(this, "_offset");
    this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](2, 1, 0, 0.8)), this["_repeat"] = a$b["defaultValue"](c2["repeat"], 30), this["_thickness"] = a$b["defaultValue"](c2["thickness"], 0.3), this["_offset"] = 0;
  }
  ["getType"](c2) {
    return MaterialType["CylinderWave"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), this["_offset"] -= 1e-3, this["_offset"] > 1 && (this["_offset"] = 0), d2["color"] = this["_color"], d2["repeat"] = this["_repeat"], d2["offset"] = this["_offset"], d2["thickness"] = this["_thickness"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof CylinderWaveMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_repeat"] == c2["_repeat"] && this["_offset"] == c2["_offset"] && this["_thickness"] == c2["_thickness"];
  }
}
registerProperty(MaterialType["CylinderWave"], CylinderWaveMaterialProperty), a$b["Material"]["CylinderWaveType"] = MaterialType["CylinderWave"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["CylinderWaveType"], { "fabric": { "type": a$b["Material"]["CylinderWave"], "uniforms": { "color": new a$b["Color"](2, 1, 0, 0.8), "repeat": 30, "thickness": 0.3, "offset": 0 }, "source": CylinderWaveMaterial_default }, "translucent": !![] });
var EllipsoidElectricMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\n#define pi 3.1415926535\r\n#define PI2RAD 0.01745329252\r\n#define TWO_PI (2. * PI)\n\nfloat rands(float p){\r\n  return fract(sin(p) * 10000.0);\r\n}\n\nfloat noise(vec2 p){\r\n  float time = fract( czm_frameNumber * speed / 1000.0);\r\n  float t = time / 20000.0;\r\n  if(t > 1.0) t -= floor(t);\r\n  return rands(p.x * 14. + p.y * sin(t) * 0.5);\r\n}\n\nvec2 sw(vec2 p){\r\n  return vec2(floor(p.x), floor(p.y));\r\n}\n\nvec2 se(vec2 p){\r\n  return vec2(ceil(p.x), floor(p.y));\r\n}\n\nvec2 nw(vec2 p){\r\n  return vec2(floor(p.x), ceil(p.y));\r\n}\n\nvec2 ne(vec2 p){\r\n  return vec2(ceil(p.x), ceil(p.y));\r\n}\n\nfloat smoothNoise(vec2 p){\r\n  vec2 inter = smoothstep(0.0, 1.0, fract(p));\r\n  float s = mix(noise(sw(p)), noise(se(p)), inter.x);\r\n  float n = mix(noise(nw(p)), noise(ne(p)), inter.x);\r\n  return mix(s, n, inter.y);\r\n}\n\nfloat fbm(vec2 p){\r\n  float z = 2.0;\r\n  float rz = 0.0;\r\n  vec2 bp = p;\r\n  for(float i = 1.0; i < 6.0; i++){\r\n    rz += abs((smoothNoise(p) - 0.5)* 2.0) / z;\r\n    z *= 2.0;\r\n    p *= 2.0;\r\n  }\r\n  return rz;\r\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec2 st2 = materialInput.st;\r\n  float time = fract( czm_frameNumber * speed / 1000.0);\r\n  if (st.t < 0.5) {\r\n    discard;\r\n  }\r\n  st *= 4.;\r\n  float rz = fbm(st);\r\n  st /= exp(mod( time * 2.0, pi));\r\n  rz *= pow(15., 0.9);\r\n  vec4 temp = vec4(0);\r\n  temp = mix( color / rz, vec4(color.rgb, 0.1), 0.2);\r\n  if (st2.s < 0.05) {\r\n    temp = mix(vec4(color.rgb, 0.1), temp, st2.s / 0.05);\r\n  }\r\n  if (st2.s > 0.95){\r\n    temp = mix(temp, vec4(color.rgb, 0.1), (st2.s - 0.95) / 0.05);\r\n  }\r\n  material.diffuse = temp.rgb;\r\n  material.alpha = temp.a * 2.0;\r\n  return material;\r\n}";
class EllipsoidElectricMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_speed"] = a$b["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["EllipsoidElectric"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof EllipsoidElectricMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["EllipsoidElectric"], EllipsoidElectricMaterialProperty), a$b["Material"]["EllipsoidElectricType"] = MaterialType["EllipsoidElectric"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["EllipsoidElectricType"], { "fabric": { "type": a$b["Material"]["EllipsoidElectricType"], "uniforms": { "color": new a$b["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": EllipsoidElectricMaterial_default }, "translucent": !![] });
var EllipsoidWaveMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float time = fract(czm_frameNumber * speed / 1000.0);\r\n  float alpha = abs(smoothstep(0.5,1.,fract( -st.t - time)));\r\n  alpha += .1;\r\n  material.alpha = alpha;\r\n  material.diffuse = color.rgb;\r\n  return material;\r\n}";
class EllipsoidWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_speed"] = a$b["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["EllipsoidWave"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof EllipsoidWaveMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["EllipsoidWave"], EllipsoidWaveMaterialProperty), a$b["Material"]["EllipsoidWaveType"] = MaterialType["EllipsoidWave"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["EllipsoidWaveType"], { "fabric": { "type": a$b["Material"]["EllipsoidWaveType"], "uniforms": { "color": new a$b["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": EllipsoidWaveMaterial_default }, "translucent": !![] });
class Image2MaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_opacity");
    this["_image"] = c2["image"], this["_opacity"] = a$b["defaultValue"](c2["opacity"], 1), this["_color"] = a$b["defaultValue"](c2["color"], a$b["Color"]["WHITE"]);
  }
  ["getType"](c2) {
    return MaterialType["Image2"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = this["_color"], d2["opacity"] = this["_opacity"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof Image2MaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_opacity"] == c2["_opacity"] && this["_image"] == c2["_image"];
  }
}
registerProperty(MaterialType["Image2"], Image2MaterialProperty), a$b["Material"]["Image2Type"] = MaterialType["Image2"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["Image2Type"], { "fabric": { "type": a$b["Material"]["Image2Type"], "uniforms": { "image": a$b["Material"]["DefaultImageId"], "color": a$b["Color"]["WHITE"], "opacity": 1 }, "source": ImageMaterial_default }, "translucent": !![] });
var LineFlickerMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  float time = fract( czm_frameNumber  *  speed / 1000.0);\r\n  vec2 st = materialInput.st;\r\n  float scalar = smoothstep(0.0,1.0,time);\r\n  material.diffuse = color.rgb * scalar;\r\n  material.alpha = color.a * scalar ;\r\n  return material;\r\n}";
class LineFlickerMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](1, 0, 0, 1)), this["_speed"] = a$b["defaultValue"](c2["speed"], 2);
  }
  ["getType"](c2) {
    return MaterialType["LineFlicker"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = getCesiumColor(this["_color"], new a$b["Color"](1, 0, 0, 1), c2), d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineFlickerMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["LineFlicker"], LineFlickerMaterialProperty), a$b["Material"]["LineFlickerType"] = MaterialType["LineFlicker"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["LineFlickerType"], { "fabric": { "type": a$b["Material"]["LineFlickerType"], "uniforms": { "color": new a$b["Color"](1, 0, 0, 0.7), "speed": 10 }, "source": LineFlickerMaterial_default }, "translucent": !![] });
var LineFlowColorMaterial_default = "uniform vec4 color;\r\nuniform float speed;\r\nuniform float startTime;\r\nuniform float percent;\r\nuniform float alpha;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float t =fract(startTime +czm_frameNumber * speed / 1000.0);\r\n  t *= (1.0 + percent);\r\n  float alpha1 = smoothstep(t- percent, t, st.s) * step(-t, -st.s);\r\n  alpha1 += alpha;\r\n  material.diffuse = color.rgb;\r\n  material.alpha = alpha1;\r\n  return material;\r\n}";
class LineFlowColorMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_percent");
    __publicField(this, "_alpha");
    __publicField(this, "_startTime");
    this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_speed"] = a$b["defaultValue"](c2["speed"], 2), this["_percent"] = a$b["defaultValue"](c2["percent"], 0.04), this["_alpha"] = a$b["defaultValue"](c2["alpha"], 0.1), this["_startTime"] = a$b["defaultValue"](c2["startTime"], 0);
  }
  ["getType"](c2) {
    return MaterialType["LineFlowColor"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = getCesiumValue(this["_color"], a$b["Color"], c2), d2["speed"] = this["_speed"], d2["percent"] = this["_percent"], d2["alpha"] = this["_alpha"], d2["startTime"] = this["_startTime"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineFlowColorMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"] && this["_percent"] == c2["_percent"] && this["_startTime"] == c2["_startTime"] && this["_alpha"] == c2["_alpha"];
  }
}
registerProperty(MaterialType["LineFlowColor"], LineFlowColorMaterialProperty), a$b["Material"]["LineFlowColorType"] = MaterialType["LineFlowColor"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["LineFlowColorType"], { "fabric": { "type": a$b["Material"]["LineFlowColorType"], "uniforms": { "color": new a$b["Color"](1, 0, 0, 0.7), "startTime": 0, "speed": 2, "percent": 0.04, "alpha": 0.1 }, "source": LineFlowColorMaterial_default }, "translucent": !![] });
var LineFlowMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = repeat * materialInput.st;\n\n    float currTime;\r\n    if(time < 0.0){\r\n     currTime = speed*czm_frameNumber/1000.0;\r\n    }\r\n    else{\r\n     currTime = time;\r\n    }\n\n    vec4 colorImage = texture2D(image, vec2(fract((axisY?st.t:st.s) - currTime), st.t));\r\n    if(color.a == 0.0) {\r\n       if(colorImage.rgb == vec3(1.0)){\r\n          discard;\r\n        }\r\n        material.alpha = colorImage.a;\r\n        material.diffuse = colorImage.rgb;\r\n    }\r\n    else {\r\n        material.alpha = colorImage.a * color.a;\r\n        material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\r\n    }\n\n    if(hasImage2)  {\r\n        vec4 colorBG = texture2D(image2,materialInput.st);\r\n        if(colorBG.a>0.5){\r\n            material.diffuse = color2.rgb;\r\n        }\r\n    }\r\n    return material;\r\n}";
class LineFlowMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_axisY");
    __publicField(this, "_duration");
    __publicField(this, "_repeat");
    __publicField(this, "_image2");
    __publicField(this, "_color2");
    __publicField(this, "_hasImage2");
    __publicField(this, "_time");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_axisY"] = a$b["defaultValue"](c2["axisY"], ![]), this["_speed"] = a$b["defaultValue"](c2["speed"], 10), this["_duration"] = c2["duration"], this["_repeat"] = a$b["defaultValue"](c2["repeat"], new a$b["Cartesian2"](1, 1)), this["_image2"] = c2["image2"], this["_color2"] = getCesiumColor(c2["color2"], new a$b["Color"](1, 1, 1)), this["_hasImage2"] = a$b["defined"](this["_image2"]);
  }
  ["getType"](c2) {
    return MaterialType["LineFlow"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = getCesiumValue(this["_color"], a$b["Color"], c2), d2["repeat"] = getCesiumValue(this["_repeat"], a$b["Cartesian2"], c2), d2["axisY"] = this["_axisY"], d2["speed"] = getCesiumValue(this["_speed"], Number, c2), this["_duration"] ? (this["_time"] === void 0 && (this["_time"] = (/* @__PURE__ */ new Date())["getTime"]()), d2["time"] = ((/* @__PURE__ */ new Date())["getTime"]() - this["_time"]) / (this["_duration"] * 1e3)) : d2["time"] = -1, d2["hasImage2"] = this["_hasImage2"], d2["image2"] = this["_image2"], d2["color2"] = getCesiumValue(this["_color2"], a$b["Color"], c2), d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineFlowMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && a$b["Property"]["equals"](this["_repeat"], c2["_repeat"]) && this["_image"] == c2["_image"] && this["_axisY"] == c2["_axisY"] && this["_speed"] == c2["_speed"] && this["_hasImage2"] == c2["_hasImage2"] && this["_image2"] == c2["_image2"] && a$b["Property"]["equals"](this["_color2"], c2["_color2"]);
  }
}
registerProperty(MaterialType["LineFlow"], LineFlowMaterialProperty), a$b["Material"]["LineFlowType"] = MaterialType["LineFlow"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["LineFlowType"], { "fabric": { "type": a$b["Material"]["LineFlowType"], "uniforms": { "image": a$b["Material"]["DefaultImageId"], "color": new a$b["Color"](1, 0, 0, 1), "repeat": new a$b["Cartesian2"](1, 1), "axisY": ![], "speed": 10, "time": -1, "hasImage2": ![], "image2": a$b["Material"]["DefaultImageId"], "color2": new a$b["Color"](1, 1, 1) }, "source": LineFlowMaterial_default }, "translucent": !![] });
var LineTrailMaterial_default = "uniform vec4 bgColor;\r\nuniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float time = fract(czm_frameNumber * speed / 1000.0);\n\n  vec3 fragColor = color.rgb;\r\n  if(st.t > 0.45 && st.t < 0.55 ) {\r\n    fragColor = vec3(1.0);\r\n  }\r\n  material.alpha =  color.a * 1.5 * smoothstep(.0,1., fract(st.s - time));\r\n  material.diffuse = max(fragColor.rgb * material.alpha , fragColor.rgb);\n\n  if(material.alpha < bgColor.a){\r\n    material.alpha = bgColor.a;\r\n    material.diffuse = bgColor.rgb;\r\n  }\n\n  return material;\r\n}";
class LineTrailMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_bgColor");
    this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_bgColor"] = getCesiumColor(c2["bgColor"], this["_color"]["withAlpha"](0.1)), this["_speed"] = a$b["defaultValue"](c2["speed"], 2);
  }
  ["getType"](c2) {
    return MaterialType["LineTrail"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["bgColor"] = this["_bgColor"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineTrailMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && a$b["Property"]["equals"](this["_bgColor"], c2["_bgColor"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["LineTrail"], LineTrailMaterialProperty), a$b["Material"]["LineTrailType"] = MaterialType["LineTrail"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["LineTrailType"], { "fabric": { "type": a$b["Material"]["LineTrailType"], "uniforms": { "color": new a$b["Color"](1, 0, 0, 0.7), "bgColor": new a$b["Color"](0, 0, 0, 0), "speed": 5 }, "source": LineTrailMaterial_default }, "translucent": !![] });
var ODLineMaterial_default = "uniform vec4 color;\r\nuniform vec4 bgColor;\r\nuniform float speed;\r\nuniform float startTime;\r\nuniform float bidirectional;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = materialInput.st;\r\n    float t = fract(startTime + czm_frameNumber * speed / 1000.0);\n\n    t *= 1.03;\r\n    float alpha0 = smoothstep(t - 0.03, t, st.s) * step(st.s, t);\r\n    float mt = 1. - t;\r\n    float alpha1 = smoothstep(mt + 0.03, mt, st.s) * step(mt, st.s);\n\n    float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.);\r\n    float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.);\r\n    float db = step(abs(bidirectional - 2.0) - 0.001, 0.);\r\n    float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db);\r\n    alpha = clamp(alpha, 0., 1.);\n\n    material.diffuse = color.rgb * alpha + bgColor.rgb * (1. - alpha);\r\n    material.alpha = color.a * alpha + bgColor.a * (1. - alpha);\n\n    \n    \n    \n    \n    \n    \n\n    return material;\r\n}";
class ODLineMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_bgColor");
    __publicField(this, "_startTime");
    __publicField(this, "_bidirectional");
    this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](Math["random"]() * 0.5 + 0.5, Math["random"]() * 0.8 + 0.2, 0, 1)), this["_bgColor"] = getCesiumColor(c2["bgColor"], this["_color"]["withAlpha"](0.1)), this["_speed"] = a$b["defaultValue"](c2["speed"], 20 + 10 * Math["random"]()), this["_startTime"] = a$b["defaultValue"](c2["startTime"], Math["random"]()), this["_bidirectional"] = a$b["defaultValue"](c2["bidirectional"], 0);
  }
  ["getType"](c2) {
    return MaterialType["ODLine"];
  }
  ["getValue"](c2, d2) {
    return !d2 && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["startTime"] = this["_startTime"], d2["bgColor"] = this["_bgColor"], d2["bidirectional"] = this["_bidirectional"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof ODLineMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && a$b["Property"]["equals"](this["_bgColor"], c2["_bgColor"]) && this["_speed"] == c2["_speed"] && this["_startTime"] == c2["_startTime"] && this["_bidirectional"] == c2["_bidirectional"];
  }
}
registerProperty(MaterialType["ODLine"], ODLineMaterialProperty), a$b["Material"]["ODLineType"] = MaterialType["ODLine"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["ODLineType"], { "fabric": { "type": a$b["Material"]["ODLineType"], "uniforms": { "color": new a$b["Color"](1, 1, 0, 0.7), "startTime": 0, "speed": 20, "bgColor": new a$b["Color"](1, 1, 0, 0.1), "bidirectional": 0 }, "source": ODLineMaterial_default }, "translucent": !![] });
var PolyAsphaltMaterial_default = "uniform vec4 asphaltColor;\r\nuniform float bumpSize;\r\nuniform float roughness;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  \n  vec4 color = asphaltColor;\r\n  vec2 st = materialInput.st;\r\n  vec2 F = czm_cellular(st / bumpSize);\r\n  color.rgb -= (F.x / F.y) * 0.1;\n\n  \n  float noise = czm_snoise(st / bumpSize);\r\n  noise = pow(noise, 5.0) * roughness;\r\n  color.rgb += noise;\n\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyAsphaltMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_bumpSize");
    __publicField(this, "_roughness");
    this["_color"] = getCesiumColor(c2["asphaltColor"], a$b["Color"]["ORANGE"]), this["_bumpSize"] = a$b["defaultValue"](c2["bumpSize"], 0.02), this["_roughness"] = a$b["defaultValue"](c2["roughness"], 0.2);
  }
  ["getType"](c2) {
    return MaterialType["PolyAsphalt"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["asphaltColor"] = this["_color"], d2["bumpSize"] = this["_bumpSize"], d2["roughness"] = this["_roughness"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyAsphaltMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_bumpSize"] == c2["_bumpSize"] && this["_roughness"] == c2["_roughness"];
  }
}
registerProperty(MaterialType["PolyAsphalt"], PolyAsphaltMaterialProperty), a$b["Material"]["PolyAsphaltType"] = MaterialType["PolyAsphalt"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["PolyAsphaltType"], { "fabric": { "type": a$b["Material"]["PolyAsphaltType"], "uniforms": { "asphaltColor": a$b["Color"]["ORANGE"], "bumpSize": 0.02, "roughness": 0.2 }, "source": PolyAsphaltMaterial_default }, "translucent"(c2) {
  return c2["uniforms"]["asphaltColor"]["alpha"] < 1;
} });
var PolyBlobMaterial_default = "uniform vec4 lightColor;\r\nuniform vec4 darkColor;\r\nuniform float frequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  vec2 F = czm_cellular(materialInput.st * frequency);\r\n  float t = 1.0 - F.x * F.x;\n\n  vec4 color = mix(lightColor, darkColor, t);\r\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyBlobMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_lightColor");
    __publicField(this, "_darkColor");
    __publicField(this, "_frequency");
    this["_lightColor"] = getCesiumColor(c2["lightColor"], new a$b["Color"](1, 1, 1, 0.5)), this["_darkColor"] = getCesiumColor(c2["darkColor"], new a$b["Color"](0, 0, 1, 0.5)), this["_frequency"] = a$b["defaultValue"](c2["frequency"], 10);
  }
  ["getType"](c2) {
    return MaterialType["PolyBlob"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["lightColor"] = this["_lightColor"], d2["darkColor"] = this["_darkColor"], d2["frequency"] = this["_frequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyBlobMaterialProperty && a$b["Property"]["equals"](this["_lightColor"], c2["_lightColor"]) && a$b["Property"]["equals"](this["_darkColor"], c2["_darkColor"]) && this["_frequency"] == c2["_frequency"];
  }
}
registerProperty(MaterialType["PolyBlob"], PolyBlobMaterialProperty), a$b["Material"]["PolyBlobType"] = MaterialType["PolyBlob"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["PolyBlobType"], { "fabric": { "type": a$b["Material"]["PolyBlobType"], "uniforms": { "lightColor": new a$b["Color"](1, 1, 1, 0.5), "darkColor": new a$b["Color"](0, 0, 1, 0.5), "frequency": 10 }, "source": PolyBlobMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["lightColor"]["alpha"] < 1 || d2["darkColor"]["alpha"] < 0;
} });
var PolyFacetMaterial_default = "uniform vec4 lightColor;\r\nuniform vec4 darkColor;\r\nuniform float frequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  vec2 F = czm_cellular(materialInput.st * frequency);\r\n  float t = 0.1 + (F.y - F.x);\n\n  vec4 color = mix(lightColor, darkColor, t);\r\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyFacetMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_lightColor");
    __publicField(this, "_darkColor");
    __publicField(this, "_frequency");
    this["_lightColor"] = getCesiumColor(c2["lightColor"], new a$b["Color"](0.25, 0.25, 0.25, 0.75)), this["_darkColor"] = getCesiumColor(c2["darkColor"], new a$b["Color"](0.25, 0.25, 0.25, 0.75)), this["_frequency"] = a$b["defaultValue"](c2["frequency"], 10);
  }
  ["getType"](c2) {
    return MaterialType["PolyFacet"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["lightColor"] = this["_lightColor"], d2["darkColor"] = this["_darkColor"], d2["frequency"] = this["_frequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyFacetMaterialProperty && a$b["Property"]["equals"](this["_lightColor"], c2["_lightColor"]) && a$b["Property"]["equals"](this["_darkColor"], c2["_darkColor"]) && this["_frequency"] == c2["_frequency"];
  }
}
registerProperty(MaterialType["PolyFacet"], PolyFacetMaterialProperty), a$b["Material"]["PolyFacetType"] = MaterialType["PolyFacet"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["PolyFacetType"], { "fabric": { "type": a$b["Material"]["PolyFacetType"], "uniforms": { "lightColor": new a$b["Color"](0.25, 0.25, 0.25, 0.75), "darkColor": new a$b["Color"](0.75, 0.75, 0.75, 0.75), "frequency": 10 }, "source": PolyFacetMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["lightColor"]["alpha"] < 1 || d2["darkColor"]["alpha"] < 0;
} });
var PolyGradientMaterial_default = "uniform vec4 color;\r\nuniform float diffusePower;\r\nuniform float alphaPower;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float alpha = distance(st,vec2(0.5, 0.5));\r\n  material.alpha = color.a  * alpha  * alphaPower;\r\n  material.diffuse = color.rgb * diffusePower;\r\n  return material;\r\n}";
class PolyGradientMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_diffusePower");
    this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](1, 1, 0, 0.5)), this["_diffusePower"] = a$b["defaultValue"](c2["diffusePower"], 1.6);
  }
  ["getType"](c2) {
    return MaterialType["PolyGradient"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["diffusePower"] = this["_diffusePower"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyGradientMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_diffusePower"] == c2["_diffusePower"];
  }
}
registerProperty(MaterialType["PolyGradient"], PolyGradientMaterialProperty), a$b["Material"]["PolyGradientType"] = MaterialType["PolyGradient"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["PolyGradientType"], { "fabric": { "type": a$b["Material"]["PolyGradientType"], "uniforms": { "color": new a$b["Color"](1, 1, 0, 0.5), "diffusePower": 1.6, "alphaPower": 1.5 }, "source": PolyGradientMaterial_default }, "translucent": !![] });
var PolyGrassMaterial_default = "uniform vec4 grassColor;\r\nuniform vec4 dirtColor;\r\nuniform float frequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  vec2 st = materialInput.st;\r\n  float noise1 = (czm_snoise(st * frequency * 1.0)) * 1.0;\r\n  float noise2 = (czm_snoise(st * frequency * 2.0)) * 0.5;\r\n  float noise3 = (czm_snoise(st * frequency * 4.0)) * 0.25;\r\n  float noise = sin(noise1 + noise2 + noise3) * 0.1;\n\n  vec4 color = mix(grassColor, dirtColor, noise);\n\n  \n  float verticalNoise = czm_snoise(vec2(st.x * 100.0, st.y * 20.0)) * 0.02;\r\n  float horizontalNoise = czm_snoise(vec2(st.x * 20.0, st.y * 100.0)) * 0.02;\r\n  float stripeNoise = min(verticalNoise, horizontalNoise);\n\n  color.rgb += stripeNoise;\n\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyGrassMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_grassColor");
    __publicField(this, "_dirtColor");
    __publicField(this, "_frequency");
    this["_grassColor"] = getCesiumColor(c2["grassColor"], new a$b["Color"](0.25, 0.4, 0.1, 1)), this["_dirtColor"] = getCesiumColor(c2["dirtColor"], new a$b["Color"](0.1, 0.1, 0.1, 1)), this["_frequency"] = a$b["defaultValue"](c2["frequency"], 10);
  }
  ["getType"](c2) {
    return MaterialType["PolyGrass"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["grassColor"] = this["_grassColor"], d2["dirtColor"] = this["_dirtColor"], d2["frequency"] = this["_frequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyGrassMaterialProperty && a$b["Property"]["equals"](this["_grassColor"], c2["_grassColor"]) && a$b["Property"]["equals"](this["_dirtColor"], c2["_dirtColor"]) && this["_frequency"] == c2["_frequency"];
  }
}
registerProperty(MaterialType["PolyGrass"], PolyGrassMaterialProperty), a$b["Material"]["PolyGrassType"] = MaterialType["PolyGrass"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["PolyGrassType"], { "fabric": { "type": a$b["Material"]["PolyGrassType"], "uniforms": { "grassColor": new a$b["Color"](0.25, 0.4, 0.1, 1), "dirtColor": new a$b["Color"](0.1, 0.1, 0.1, 1), "frequency": 1.5 }, "source": PolyGrassMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["grassColor"]["alpha"] < 1 || d2["dirtColor"]["alpha"] < 1;
} });
var PolyWoodMaterial_default = "uniform vec4 lightWoodColor;\r\nuniform vec4 darkWoodColor;\r\nuniform float frequency;\r\nuniform vec2 noiseScale;\r\nuniform float grainFrequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  vec2 st = materialInput.st;\n\n  vec2 noisevec;\r\n  noisevec.x = czm_snoise(st * noiseScale.x);\r\n  noisevec.y = czm_snoise(st * noiseScale.y);\n\n  vec2 location = st + noisevec;\r\n  float dist = sqrt(location.x * location.x + location.y * location.y);\r\n  dist *= frequency;\n\n  float r = fract(dist + noisevec[0] + noisevec[1]) * 2.0;\r\n  if(r > 1.0)\r\n      r = 2.0 - r;\n\n  vec4 color = mix(lightWoodColor, darkWoodColor, r);\n\n  \n  r = abs(czm_snoise(vec2(st.x * grainFrequency, st.y * grainFrequency * 0.02))) * 0.2;\r\n  color.rgb += lightWoodColor.rgb * r;\n\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyWoodMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_lightWoodColor");
    __publicField(this, "_darkWoodColor");
    __publicField(this, "_frequency");
    __publicField(this, "_noiseScale");
    __publicField(this, "_grainFrequency");
    this["_lightWoodColor"] = getCesiumColor(c2["lightWoodColor"], new a$b["Color"](1, 1, 1, 0.5)), this["_darkWoodColor"] = getCesiumColor(c2["darkWoodColor"], new a$b["Color"](0, 0, 1, 0.5)), this["_frequency"] = a$b["defaultValue"](c2["frequency"], 3), this["_noiseScale"] = a$b["defaultValue"](c2["noiseScale"], new a$b["Cartesian2"](0.7, 0.5)), this["_grainFrequency"] = a$b["defaultValue"](c2["grainFrequency"], 27);
  }
  ["getType"](c2) {
    return MaterialType["PolyWood"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["lightWoodColor"] = this["_lightWoodColor"], d2["darkWoodColor"] = this["_darkWoodColor"], d2["frequency"] = this["_frequency"], d2["noiseScale"] = this["_noiseScale"], d2["grainFrequency"] = this["_grainFrequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyWoodMaterialProperty && a$b["Property"]["equals"](this["_lightWoodColor"], c2["_lightWoodColor"]) && a$b["Property"]["equals"](this["_darkWoodColor"], c2["_darkWoodColor"]) && a$b["Property"]["equals"](this["_noiseScale"], c2["_noiseScale"]) && this["_frequency"] == c2["_frequency"] && this["_grainFrequency"] == c2["_grainFrequency"];
  }
}
registerProperty(MaterialType["PolyWood"], PolyWoodMaterialProperty), a$b["Material"]["PolyWoodType"] = MaterialType["PolyWood"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["PolyWoodType"], { "fabric": { "type": a$b["Material"]["PolyWoodType"], "uniforms": { "lightWoodColor": new a$b["Color"](0.6, 0.3, 0.1, 1), "darkWoodColor": new a$b["Color"](0.4, 0.2, 0.07, 1), "frequency": 3, "noiseScale": new a$b["Cartesian2"](0.7, 0.5), "grainFrequency": 27 }, "source": PolyWoodMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["lightWoodColor"]["alpha"] < 1 || d2["darkWoodColor"]["alpha"] < 1;
} });
var RadarLineMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st * 2.0 - 1.0;\r\n  float t = czm_frameNumber * speed / 1000.0 ;\r\n  vec3 col = vec3(0.0);\r\n  vec2 p = vec2(sin(t), cos(t));\r\n  float d = length(st - dot(p, st) * p);\r\n  if (dot(st, p) < 0.) {\r\n    d = length(st);\r\n  }\n\n  col = .006 / d * color.rgb;\n\n  if(distance(st,vec2(0)) >  0.99 ){\r\n    col =color.rgb;\r\n  }\n\n  material.alpha  = pow(length(col),2.0);\r\n  material.diffuse = col * 3.0 ;\r\n  return material;\r\n}";
class RadarLineMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_speed"] = a$b["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["RadarLine"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof RadarLineMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["RadarLine"], RadarLineMaterialProperty), a$b["Material"]["RadarLineType"] = MaterialType["RadarLine"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["RadarLineType"], { "fabric": { "type": a$b["Material"]["RadarLineType"], "uniforms": { "color": new a$b["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": RadarLineMaterial_default }, "translucent": !![] });
var RadarWaveMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\n#define PI 3.14159265359\n\nfloat rand(vec2 co){\r\n  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\r\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec2 pos = st - vec2(0.5);\r\n  float time = czm_frameNumber * speed / 1000.0 ;\r\n  float r = length(pos);\r\n  float t = atan(pos.y, pos.x) - time * 2.5;\r\n  float a = (atan(sin(t), cos(t)) + PI)/(2.0*PI);\r\n  float ta = 0.5;\r\n  float v = smoothstep(ta-0.05,ta+0.05,a) * smoothstep(ta+0.05,ta-0.05,a);\r\n  vec3 flagColor = color.rgb * v;\r\n  float blink = pow(sin(time*1.5)*0.5+0.5, 0.8);\r\n  flagColor = color.rgb *  pow(a, 8.0*(.2+blink))*(sin(r*500.0)*.5+.5) ;\r\n  flagColor = flagColor * pow(r, 0.4);\r\n  material.alpha = length(flagColor) * 1.3;\r\n  material.diffuse = flagColor * 3.0;\r\n  return material;\r\n}";
class RadarWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](0, 0, 0, 0)), this["_speed"] = a$b["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["RadarWave"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof RadarWaveMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["RadarWave"], RadarWaveMaterialProperty), a$b["Material"]["RadarWaveType"] = MaterialType["RadarWave"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["RadarWaveType"], { "fabric": { "type": a$b["Material"]["RadarWaveType"], "uniforms": { "color": new a$b["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": RadarWaveMaterial_default }, "translucent": !![] });
var RectSlideMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n     czm_material material = czm_getDefaultMaterial(materialInput);\r\n     vec2 st = materialInput.st;\r\n     vec4 colorImage = texture2D(image, vec2(fract(st.s + czm_frameNumber * speed / 1000.0),fract(st.t)));\n\n    material.alpha = colorImage.a * color.a;\r\n    if(pure) {\r\n        material.diffuse = diffusePower * color.rgb;\r\n    }\r\n    else {\r\n        material.diffuse = colorImage.rgb;\r\n    }\r\n    return material;\r\n }";
class RectSlideMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_pure");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], new a$b["Color"](1, 1, 1, 0.9)), this["_speed"] = a$b["defaultValue"](c2["speed"], 1), this["_pure"] = !!c2["pure"];
  }
  ["getType"](c2) {
    return MaterialType["RectSlide"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["pure"] = this["_pure"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof RectSlideMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_image"] == c2["_image"] && this["_pure"] == c2["_pure"] && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["RectSlide"], RectSlideMaterialProperty), a$b["Material"]["RectSlideType"] = MaterialType["RectSlide"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["RectSlideType"], { "fabric": { "type": a$b["Material"]["RectSlideType"], "uniforms": { "image": a$b["Material"]["DefaultImageId"], "color": a$b["Color"]["WHITE"], "speed": 10, "pure": ![], "diffusePower": 1.3 }, "source": RectSlideMaterial_default }, "translucent": !![] });
var ScanLineMaterial_default = "float circle(vec2 uv, float r, float blur) {\r\n    float d = length(uv) * 2.0;\r\n    float c = smoothstep(r+blur, r, d);\r\n    return c;\r\n}\n\nuniform vec4 color;\r\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = materialInput.st - .5;\r\n    material.diffuse = color.rgb;\r\n    material.emission = vec3(0);\n\n    float t =fract(czm_frameNumber * speed / 1000.0);\r\n    float s = 0.3;\r\n    float radius1 = smoothstep(.0, s, t) * 0.5;\r\n    float alpha1 = circle(st, radius1, 0.01) * circle(st, radius1, -0.01);\r\n    float alpha2 = circle(st, radius1, 0.01 - radius1) * circle(st, radius1, 0.01);\r\n    float radius2 = 0.5 + smoothstep(s, 1.0, t) * 0.5;\r\n    float alpha3 = circle(st, radius1, radius2 + 0.01 - radius1) * circle(st, radius1, -0.01);\n\n    material.alpha = smoothstep(1.0, s, t) * (alpha1 + alpha2*0.1 + alpha3*0.1);\r\n    material.alpha *= color.a;\n\n    return material;\r\n}";
class ScanLineMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], a$b["Color"]["YELLOW"]), this["_speed"] = a$b["defaultValue"](c2["speed"], 10);
  }
  ["getType"](c2) {
    return MaterialType["ScanLine"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof ScanLineMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["ScanLine"], ScanLineMaterialProperty), a$b["Material"]["ScanLineType"] = MaterialType["ScanLine"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["ScanLineType"], { "fabric": { "type": a$b["Material"]["ScanLineType"], "uniforms": { "color": new a$b["Color"](1, 1, 0, 1), "speed": 10 }, "source": ScanLineMaterial_default }, "translucent": !![] });
class TextMaterialProperty extends Image2MaterialProperty {
  constructor(b2) {
    super({ ...b2, "image": "" });
    __publicField(this, "transparent");
    __publicField(this, "_textStyles");
    __publicField(this, "_canvas");
    this["transparent"] = !![], this["options"]["text"] = b2["text"], b2["font_size"] = b2["font_size"] || 70, this["_textStyles"] = LabelStyleConver["toCesiumVal"](b2, { "fill": !![], "fillColor": new a$b["Color"](1, 1, 0, 1), "textBaseline": "middle", "padding": 10 }), this["_updateImage"]();
  }
  get ["text"]() {
    return this["options"]["text"];
  }
  set ["text"](b2) {
    this["options"]["text"] = b2, this["_updateImage"]();
  }
  get ["textStyles"]() {
    return this["_textStyles"];
  }
  set ["textStyles"](b2) {
    this["_textStyles"] = LabelStyleConver["toCesiumVal"](b2, this["_textStyles"]), this["_updateImage"]();
  }
  ["_updateImage"]() {
    var _a;
    this["_canvas"] = getTextImage(this["options"]["text"], this["_textStyles"]);
    if (this["_canvas"]) {
      this["_image"] = this["_canvas"]["toDataURL"]("image/png");
      if ((_a = this["options"]) == null ? void 0 : _a["onCustomCanvas"]) {
        const b2 = this["options"]["onCustomCanvas"](this["_canvas"], this);
        (b2 == null ? void 0 : b2["then"]) && b2["then"]((c2) => {
          this["_image"] = c2["toDataURL"]("image/png");
        });
      }
    }
  }
}
registerProperty(MaterialType["Text"], TextMaterialProperty);
var WallScrollMaterial_default = "uniform sampler2D image;\r\nuniform float speed;\r\nuniform vec4 color;\r\nuniform float count;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  float perDis = 1.0 / count / 3.0  ;\r\n  vec2 st = materialInput.st * vec2(1.0,count);\r\n  float time = fract(czm_frameNumber * speed / 1000.0);\r\n  vec4 colorImage = texture2D(image, vec2(fract(st.t - time),st.t));\r\n  material.alpha =  colorImage.a * smoothstep(.2 ,1. ,distance(st.t * perDis ,1. + perDis ));\r\n  material.diffuse = max(color.rgb * material.alpha * 1.5, color.rgb);\r\n  material.emission = max(color.rgb * material.alpha * 1.5, color.rgb);\r\n  return material;\r\n}";
class WallScrollMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_count");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], a$b["Color"]["RED"]), this["_speed"] = a$b["defaultValue"](c2["speed"], 10), this["_count"] = a$b["defaultValue"](c2["count"], 1);
  }
  ["getType"](c2) {
    return MaterialType["WallScroll"];
  }
  ["getValue"](c2, d2) {
    return !a$b["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["count"] = this["_count"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof WallScrollMaterialProperty && a$b["Property"]["equals"](this["_color"], c2["_color"]) && this["_image"] == c2["_image"] && this["_count"] == c2["_count"] && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["WallScroll"], WallScrollMaterialProperty), a$b["Material"]["WallScrollType"] = MaterialType["WallScroll"], a$b["Material"]["_materialCache"]["addMaterial"](a$b["Material"]["WallScrollType"], { "fabric": { "type": a$b["Material"]["WallScrollType"], "uniforms": { "color": new a$b["Color"](1, 0, 0, 0.7), "image": a$b["Material"]["DefaultImageId"], "count": 1, "speed": 5 }, "source": WallScrollMaterial_default }, "translucent": !![] });
class WaterMaterialProperty extends BaseMaterialProperty {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "baseWaterColor");
    __publicField(this, "blendColor");
    __publicField(this, "specularMap");
    __publicField(this, "normalMap");
    __publicField(this, "frequency");
    __publicField(this, "animationSpeed");
    __publicField(this, "amplitude");
    __publicField(this, "specularIntensity");
    __publicField(this, "fadeFactor");
    this["baseWaterColor"] = getCesiumColor(b2["baseWaterColor"], new a$b["Color"](0.2, 0.3, 0.6, 1)), this["blendColor"] = getCesiumColor(b2["blendColor"], new a$b["Color"](0, 1, 0.699, 1)), this["specularMap"] = b2["specularMap"] || a$b["Material"]["DefaultImageId"], this["normalMap"] = b2["normalMap"] || a$b["Material"]["DefaultImageId"], this["frequency"] = a$b["defaultValue"](b2["frequency"], 1e3), this["animationSpeed"] = a$b["defaultValue"](b2["animationSpeed"], 0.01), this["amplitude"] = a$b["defaultValue"](b2["amplitude"], 10), this["specularIntensity"] = a$b["defaultValue"](b2["specularIntensity"], 0.5), this["fadeFactor"] = a$b["defaultValue"](b2["fadeFactor"], 1);
  }
  ["getType"](b2) {
    return MaterialType["Water"];
  }
  ["getValue"](b2, c2) {
    return !c2 && (c2 = {}), c2["baseWaterColor"] = a$b["Property"]["getValueOrUndefined"](this["baseWaterColor"], b2), c2["blendColor"] = a$b["Property"]["getValueOrUndefined"](this["blendColor"], b2), c2["specularMap"] = a$b["Property"]["getValueOrUndefined"](this["specularMap"], b2), c2["normalMap"] = a$b["Property"]["getValueOrUndefined"](this["normalMap"], b2), c2["frequency"] = this["frequency"], c2["animationSpeed"] = this["animationSpeed"], c2["amplitude"] = this["amplitude"], c2["specularIntensity"] = this["specularIntensity"], c2["fadeFactor"] = this["fadeFactor"], c2;
  }
  ["equals"](b2) {
    return this == b2 || b2 instanceof WaterMaterialProperty && a$b["Property"]["equals"](this["baseWaterColor"], b2["baseWaterColor"]) && a$b["Property"]["equals"](this["blendColor"], b2["blendColor"]) && a$b["Property"]["equals"](this["specularMap"], b2["specularMap"]) && a$b["Property"]["equals"](this["normalMap"], b2["normalMap"]) && this["frequency"] == b2["frequency"] && this["animationSpeed"] == b2["animationSpeed"] && this["amplitude"] == b2["amplitude"] && this["specularIntensity"] == b2["specularIntensity"] && this["fadeFactor"] == b2["fadeFactor"];
  }
}
Object["defineProperties"](WaterMaterialProperty["prototype"], { "baseWaterColor": a$b["createPropertyDescriptor"]("baseWaterColor"), "blendColor": a$b["createPropertyDescriptor"]("blendColor"), "specularMap": a$b["createPropertyDescriptor"]("specularMap"), "normalMap": a$b["createPropertyDescriptor"]("normalMap") }), registerProperty(MaterialType["Water"], WaterMaterialProperty);
a$b["ShaderSource"]["_czmBuiltinsAndUniforms"]["czm_cellular"] = cellular_default, a$b["ShaderSource"]["_czmBuiltinsAndUniforms"]["czm_snoise"] = snoise_default;
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseMaterialProperty,
  CircleScanMaterialProperty,
  CircleWaveMaterialProperty,
  CylinderWaveMaterial,
  CylinderWaveMaterialProperty,
  EllipsoidElectricMaterialProperty,
  EllipsoidWaveMaterialProperty,
  Image2MaterialProperty,
  LineFlickerMaterialProperty,
  LineFlowColorMaterialProperty,
  LineFlowMaterialProperty,
  LineTrailMaterialProperty,
  ODLineMaterialProperty,
  PolyAsphaltMaterialProperty,
  PolyBlobMaterialProperty,
  PolyFacetMaterialProperty,
  PolyGradientMaterialProperty,
  PolyGrassMaterialProperty,
  PolyWoodMaterialProperty,
  RadarLineMaterialProperty,
  RadarWaveMaterialProperty,
  RectSlideMaterialProperty,
  ScanLineMaterialProperty,
  TextMaterial,
  TextMaterialProperty,
  WallScrollMaterialProperty,
  WaterMaterialProperty
}, Symbol.toStringTag, { value: "Module" }));
proj4["defs"]("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs"), proj4["defs"]("EPSG:4491", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4492", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4493", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4494", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4495", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4496", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4497", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4498", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4499", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4500", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4501", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4513", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4514", "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4515", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4516", "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4517", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4518", "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4519", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4520", "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4521", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4522", "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4523", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4524", "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4525", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4526", "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4527", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4528", "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4529", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4530", "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4531", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4532", "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4533", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4502", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4503", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4504", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4505", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4506", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4507", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4508", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4509", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4510", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4511", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4512", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4534", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4535", "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4536", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4537", "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4538", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4539", "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4540", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4541", "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4542", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4543", "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4544", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4545", "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4546", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4547", "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4548", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4549", "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4550", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4551", "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4552", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4553", "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4554", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs");
registerOptsConver("default", BaseMaterialConver), registerOptsConver(MaterialType["Color"], ColorOptsConver), registerOptsConver(MaterialType["PolylineArrow"], ColorOptsConver), registerOptsConver(MaterialType["Image"], ImageOptsConver);
export {
  a$b as Cesium,
  ColorPatternGradientLayer,
  ColorPatternGridLayer,
  Earth,
  index$3 as convers,
  index$2 as effects,
  index$8 as enums,
  index$1 as layers,
  index as materials,
  turf,
  index$4 as utils
};
